{"type":"mcp_client","name":"mcp-client","description":"This repository provides a REST API and CLI client for interacting with Model Context Protocol (MCP) servers, leveraging LangChain for LLM prompts and supporting various LLM providers. It enables collaboration","category":"AI","language":"Python","stars":50,"forks":11,"owner":"rakesh-eltropy","github_url":"https://github.com/rakesh-eltropy/mcp-client","homepage":null,"setup":"## Setup\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/rakesh-eltropy/mcp-client.git\n   ```\n\n2. **Navigate to the Project Directory**\n   After cloning the repository, move to the project directory:\n   ```bash\n   cd mcp-client\n   ```\n   \n3. Set the OPENAI_API_KEY environment variable:\n   ```bash\n   export OPENAI_API_KEY=your-openai-api-key\n   ```\n   You can also set the `OPENAI_API_KEY` in the [mcp-server-config.json](mcp-server-config.json) file.\n\n   You can also set the `provider` and `model` in the [mcp-server-config.json](mcp-server-config.json) file.\n   e.g. `provider` can be `ollama` and `model` can be `llama3.2:3b`.\n\n\n4.Set the BRAVE_API_KEY environment variable:\n   ```bash\n   export BRAVE_API_KEY=your-brave-api-key\n   ```\n   You can also set the `BRAVE_API_KEY` in the [mcp-server-config.json](mcp-server-config.json) file.\n   You can get the free `BRAVE_API_KEY` from [Brave Search API](https://brave.com/search/api/).\n\n5. Running from the CLI:\n   ```bash\n   uv run cli.py\n   ```\n   To explore the available commands, use the `help` option; you can chat with LLM using `chat` command.\n   Sample prompts:\n   ```bash\n     What is the capital city of India?\n    ```\n   ```bash\n     Search the most expensive product from database and find more details about it from amazon?\n    ```\n\n6. Running from the REST API:\n   ```bash\n   uvicorn app:app --reload\n   ```\n   You can use the following curl command to chat with llm:\n   ```bash\n   curl -X POST -H \"Content-Type: application/json\" -d '{\"message\": \"list all the products from my local database?\"}' http://localhost:8000/chat\n   ```\n   You can use the following curl command to chat with llm with streaming:\n   ```bash\n   curl -X POST -H \"Content-Type: application/json\" -d '{\"message\": \"list all the products from my local database?\", \"streaming\": true}' http://localhost:8000/chat\n   ```","tools":"## Available Tools\n\n1.  MCP-Compatible Servers (Supports any [MCP-compatible servers](https://github.com/punkpeye/awesome-mcp-servers) servers).\n2.  Pre-configured default servers (SQLite and Brave Search).\n3.  Additional MCP servers (Can be added in the [mcp-server-config.json](mcp-server-config.json) file).\n4.  Integrated with LangChain (Leverages LangChain to execute LLM prompts).\n5.  Collaboration of multiple MCP servers (Enables multiple MCP servers to collaborate and respond to a specific query simultaneously).\n6.  LLM Provider Support (Compatible with any LLM provider that supports APIs with function capabilities).\n7.  CLI client (Allows interaction with MCP servers from the command line).\n8.  REST API (Provides an interface to interact with MCP servers programmatically).","faq":null,"created_at":"2024-12-04T15:32:29+00:00","updated_at":"2025-03-27T12:19:46+00:00","source_url":"https://model-context-protocol.com/clients/mcp-client-rest-api-llm-interaction","related_articles":[]}