Fastmcp Local Client
A fastmcp client which connects to both local as well as remote servers.
Ask AI about Fastmcp Local Client
Powered by Claude Β· Grounded in docs
I know everything about Fastmcp Local Client. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
π MCP Multi-Server Client LangChain + FastMCP + Ollama Integration
A production-style MCP client that connects to local and remote MCP servers, loads tools dynamically, and executes them via an LLM agent.
β¨ What This Project Does
This client:
π Connects to multiple MCP servers
π§ Loads tools dynamically from MCP endpoints
π€ Uses an LLM (Ollama/HuggingFace) to decide tool usage
π Supports local (stdio) and remote (HTTP) MCP
π Loads API keys securely from .env
βοΈ Executes tool calls automatically
π§ Architecture Overview +---------------------+ | LLM Agent | | (Ollama / HF) | +----------+----------+ | v +---------------------+ | LangChain MCP | | Multi Client | +----------+----------+ | +----------+----------+ | | v v Local MCP Server Remote FastMCP Server (stdio transport) (HTTP transport)
π Project Structure . βββ client1.py # MCP client implementation βββ .env # API keys (not committed) βββ README.md
π§± Step 1 β Install Requirements
pip install langchain langchain-core
langchain-mcp-adapters
langchain-ollama
langchain-huggingface
python-dotenv
π Step 2 β Setup Environment Variables
Create a .env file:
FASTMCP_API_KEY=sk-fmcp-xxxxxxxxxxxxxxxx
This is required for remote FastMCP authentication.
π₯οΈ Step 3 β Configure MCP Servers π§ͺ Local MCP Server (stdio) "demo_server": { "transport": "stdio", "command": r"C:\Users\mrina.local\bin\uv.exe", "args": [ "run", "python", r"C:\Users\mrina\Desktop\MCP\fastmcp-demo-server\main.py" ], }
βοΈ Remote FastMCP Server (HTTP) "expense_tracker": { "transport": "http", "url": "https://cooperative-lavender-gazelle.fastmcp.app/mcp", "headers": { "Authorization": f"Bearer {os.getenv('FASTMCP_API_KEY')}" } }
