mcp-client
Documentation
MCP REST API and CLI Client
A simple REST API and CLI client to interact with Model Context Protocol (MCP) servers.
Key Features
1. MCP-Compatible Servers
- Supports any MCP-compatible servers servers.
- Pre-configured default servers:
- SQLite (test.db has been provided with sample products data)
- Brave Search
- Additional MCP servers can be added in the mcp-server-config.json file
2. Integrated with LangChain
- Leverages LangChain to execute LLM prompts.
- Enables multiple MCP servers to collaborate and respond to a specific query simultaneously.
3. LLM Provider Support
- Compatible with any LLM provider that supports APIs with function capabilities.
- Examples:
- OpenAI
- Claude
- Gemini
- AWS Nova
- Groq
- Ollama
- Essentially all LLM providers are supported as long as they provide a function-based API. Please refer langchain documentation for more details.
Setup
1. Clone the repository:
git clone https://github.com/rakesh-eltropy/mcp-client.git2. Navigate to the Project Directory
After cloning the repository, move to the project directory:
cd mcp-client3. Set the OPENAI_API_KEY environment variable:
export OPENAI_API_KEY=your-openai-api-keyYou can also set the `OPENAI_API_KEY` in the mcp-server-config.json file.
You can also set the `provider` and `model` in the mcp-server-config.json file.
e.g. `provider` can be `ollama` and `model` can be `llama3.2:3b`.
4.Set the BRAVE_API_KEY environment variable:
export BRAVE_API_KEY=your-brave-api-keyYou can also set the `BRAVE_API_KEY` in the mcp-server-config.json file.
You can get the free `BRAVE_API_KEY` from Brave Search API.
5. Running from the CLI:
uv run cli.pyTo explore the available commands, use the `help` option. You can chat with LLM using `chat` command.
Sample prompts:
What is the capital city of India?Search the most expensive product from database and find more details about it from amazon?6. Running from the REST API:
uvicorn app:app --reloadYou can use the following curl command to chat with llm:
curl -X POST -H "Content-Type: application/json" -d '{"message": "list all the products from my local database?"}' http://localhost:8000/chatYou can use the following curl command to chat with llm with streaming:
curl -X POST -H "Content-Type: application/json" -d '{"message": "list all the products from my local database?", "streaming": true}' http://localhost:8000/chatContributing
Feel free to submit issues and pull requests for improvements or bug fixes.
Frequently asked questions
What is mcp-client?
mcp-client is a Model Context Protocol (MCP) server listed in the TrackMCP directory.
How do I install mcp-client?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is mcp-client open source?
Yes — it is hosted on GitHub at https://github.com/rakesh-eltropy/mcp-client and has 49 stars.
Related MCP tools
AWS MCP Servers — helping you get the most out of AWS, wherever you use MCP. Python-based implementation. Trusted by 6900+ developers.
A simple, secure MCP-to-OpenAPI proxy server Python-based implementation. Trusted by 3500+ developers. Trusted by 3500+ developers.
MCP server that interacts with Obsidian via the Obsidian rest API community plugin Python-based implementation. Trusted by 2300+ developers.
Default Configuration: MCP CLI defaults to using Ollama with the gpt-oss reasoning model for local, privacy-focused operation without requiring API keys.
Official MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
MCP server for long term agent memory with Mem0. Also useful as a template to get you started building your own MCP server with Python!
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP