Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

MCP Client Implementation using Python, LangGraph and Gemini

License

NotificationsYou must be signed in to change notification settings

sparun160782/mcp_client

 
 

Repository files navigation

📢 Subscribe to The AI Language on YouTube!

Welcome! This project features multiple MCP clients integrated withGoogle Gemini AI to execute tasks via theModel Context Protocol (MCP) — with and without LangChain.

Happy building, and don’t forget to subscribe!

MCP Client Options

This repository includesfour MCP client options for various use cases:

OptionClient ScriptLangChainConfig SupportTransportTutorial
1client.pySTDIOLegacy Client
2langchain_mcp_client.pySTDIOLangChain Client
3langchain_mcp_client_wconfig.pySTDIOMulti-Server
4client_sse.pySSE (Loca & Web)SSE Client

If you want to add or reuse MCP Servers, check outthe MCP Servers repo.


✪ Features

✅ Connects to an MCP server (STDIO or SSE)
✅ UsesGoogle Gemini AI to interpret user prompts
✅ AllowsGemini to call MCP tools via server
✅ Executes tool commands and returns results
✅ (Upcoming) Maintains context and history for conversations


Running the MCP Client

Choose the appropriate command for your preferred client:

  • Legacy STDIOuv run client.py path/to/server.py
  • LangChain STDIOuv run langchain_mcp_client.py path/to/server.py
  • LangChain Multi-Server STDIOuv run langchain_mcp_client_wconfig.py path/to/config.json
  • SSE Clientuv run client_sse.py sse_server_url

Project Structure

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

How It Works

  1. You send a prompt:

    Create a file named test.txt

  2. The prompt is sent toGoogle Gemini AI.
  3. Gemini uses availableMCP tools to determine a response.
  4. The selected tool is executed on theconnected server.
  5. The AI returns results and maintainsconversation context (if supported).

🤝 Contributing

At this time, this project doesnot 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!

About

MCP Client Implementation using Python, LangGraph and Gemini

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python100.0%

[8]ページ先頭

©2009-2025 Movatter.jp