MCP Client Implementation using Python, LangGraph and Gemini
๐ข Subscribe to The AI Language on YouTube!
Welcome! This project features multiple MCP clients integrated with Google Gemini AI to execute tasks via the Model Context Protocol (MCP) โ with and without LangChain.
Happy building, and donโt forget to subscribe!
This repository includes four MCP client options for various use cases:
Option | Client Script | LangChain | Config Support | Transport | Tutorial |
---|---|---|---|---|---|
1 | client.py | โ | โ | STDIO | Legacy Client |
2 | langchain_mcp_client.py | โ | โ | STDIO | LangChain Client |
3 | langchain_mcp_client_wconfig.py | โ | โ | STDIO | Multi-Server |
4 | client_sse.py | โ | โ | SSE (Loca & Web) | SSE Client |
If you want to add or reuse MCP Servers, check out the MCP Servers repo.
โ
Connects to an MCP server (STDIO or SSE)
โ
Uses Google Gemini AI to interpret user prompts
โ
Allows Gemini to call MCP tools via server
โ
Executes tool commands and returns results
โ
(Upcoming) Maintains context and history for conversations
Choose the appropriate command for your preferred client:
uv run client.py path/to/server.py
uv run langchain_mcp_client.py path/to/server.py
uv run langchain_mcp_client_wconfig.py path/to/config.json
uv run client_sse.py sse_server_url
mcp-client-gemini/
โโโ client.py # Basic client (STDIO)
โโโ langchain_mcp_client.py # LangChain + Gemini
โโโ langchain_mcp_client_wconfig.py # LangChain + config.json (multi-server)
โโโ client_sse.py # SSE transport client (local or remote)
โโโ .env # API key environment file
โโโ README.md # Project documentation
โโโ requirements.txt # Dependency list
โโโ .gitignore # Git ignore rules
โโโ LICENSE # License information
Create a file named test.txt
At this time, this project does not accept external code contributions.
This is to keep licensing simple and avoid any shared copyright.
You're very welcome to:
โ
Report bugs or request features (via GitHub Issues)
โ
Fork the repo and build your own version
โ
Suggest documentation improvements
If you'd like to collaborate in another way, feel free to open a discussion!
{ "mcpServers": { "mcpclient": { "command": "uv", "args": [ "run", "client.py", "path/to/server.py" ] } } }
Related projects feature coming soon
Will recommend related projects based on sub-categories