{"id":30867434,"url":"https://github.com/RGGH/mcp-client-x","last_synced_at":"2025-09-07T22:09:17.072Z","repository":{"id":281376980,"uuid":"945092991","full_name":"RGGH/mcp-client-x","owner":"RGGH","description":"Python MCP client + server example","archived":false,"fork":false,"pushed_at":"2025-03-09T21:08:02.000Z","size":33,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T15:00:10.857Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://redandgreen.co.uk/python-sdk-for-model-context-protocol/ai-ml/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RGGH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-08T16:37:53.000Z","updated_at":"2025-04-08T02:22:10.000Z","dependencies_parsed_at":"2025-03-08T17:39:41.788Z","dependency_job_id":null,"html_url":"https://github.com/RGGH/mcp-client-x","commit_stats":null,"previous_names":["rggh/mcp-client-x"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RGGH/mcp-client-x","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RGGH%2Fmcp-client-x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RGGH%2Fmcp-client-x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RGGH%2Fmcp-client-x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RGGH%2Fmcp-client-x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RGGH","download_url":"https://codeload.github.com/RGGH/mcp-client-x/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RGGH%2Fmcp-client-x/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274102039,"owners_count":25222502,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-07T22:03:31.309Z","updated_at":"2025-09-07T22:09:17.055Z","avatar_url":"https://github.com/RGGH.png","language":"Python","funding_links":[],"categories":["🤖 AI/ML","📚 Projects (2474 total)"],"sub_categories":["MCP Servers"],"readme":"# MCP Client Example ☀️ \n\nThis project demonstrates a simple client-server implementation using the Model Context Protocol (MCP), which is a standardized way to connect large language models with tools and data.\n\n## Overview\n\nThis example shows how to:\n- Create an MCP server with custom tools\n- Connect to the server using an MCP client\n- Call tools and get responses from the server\n\n## Tutorial Video\n\n[![MCP Tutorial Video](https://img.youtube.com/vi/oq3dkNm51qc/0.jpg)](https://youtu.be/oq3dkNm51qc)\n\nClick the image above to watch a tutorial on MCP implementation.\n\n## Project Structure\n\n```\n.\n├── pyproject.toml\n├── README.md\n├── src\n│   ├── client\n│   │   └── mcp_client.py      # MCP client implementation\n│   └── server\n│       └── example_server.py  # MCP server with tools\n└── uv.lock\n```\n\n## Server Implementation\n\nThe server exposes two tools:\n1. `calculate_bmi` - A simple calculator that computes Body Mass Index\n2. `fetch_weather` - An async tool that retrieves weather data from an external API\n\n## Client Implementation\n\nThe client connects to the server via stdio, initializes a session, and calls the server's tools.\n\n## Getting Started\n\n### Prerequisites\n\n- Python 3.9+\n- uv (Python package manager)\n\n### Installation\n\n```bash\n# Install dependencies\nuv install -e .\n```\n\n### Running the Example\n\n1. Start the client (which will automatically start the server):\n\n```bash\nuv run src/client/mcp_client.py\n```\n\n## Usage\n\nThe client will:\n1. Connect to the server\n2. List available tools\n3. Call the BMI calculator with sample data\n4. Call the weather tool with sample coordinates\n\n## Example Response\n\n```\nAvailable tools: meta=None nextCursor=None tools=[...]\nBMI calculation result: 22.857142857142858\nWeather data: {\"current_weather\":{\"temperature\":14.2,\"windspeed\":12.6, ...}}\n```\n## Test with MCP Inspector \n( run command below and then visit http://localhost:5173 )\n\n```\n  ❯ mcp dev src/server/example_server.py\nStarting MCP inspector...\nProxy server listening on port 3000\n\n🔍 MCP Inspector is up and running at http://localhost:5173 🚀\nNew SSE connection\nQuery parameters: {\n  transportType: 'stdio',\n  command: 'uv',\n  args: 'run --with mcp mcp run src/server/example_server.py',\n```\n\n## Resources\n\nThis project uses:\n- [Model Context Protocol Python SDK](https://github.com/modelcontextprotocol/python-sdk)\n- [MCP Official Documentation](https://modelcontextprotocol.io)\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRGGH%2Fmcp-client-x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRGGH%2Fmcp-client-x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRGGH%2Fmcp-client-x/lists"}