You signed in with another tab or window. Reload
to refresh your session. You signed out in another tab or window. Reload
to refresh your session. You switched accounts on another tab or window. Reload
to refresh your session. Dismiss alert
dev-mahfuj80 / MCP_CLIENT Public
MCP CLIENT using python sdk.
0 stars
0 forks
Branches
Tags
Activity
Notifications
You must be signed in to change notification settings
main
Go to file
Code
| Name | | Name | Last commit message | Last commit date |
| --- | --- | --- | --- |
| Latest commit
-------------
dev-mahfuj80
updated
Mar 20, 2025
0e12697
· Mar 20, 2025
History
-------
5 Commits
| | |
| src | | src | it works not poperly | Mar 20, 2025 |
| .gitignore | | .gitignore | updated | Mar 20, 2025 |
| README.md | | README.md | Updated the code and added server | Mar 19, 2025 |
| pyproject.toml | | pyproject.toml | Updated the code and added server | Mar 19, 2025 |
| requirements.txt | | requirements.txt | it works not poperly | Mar 20, 2025 |
| uv.lock | | uv.lock | Updated the code and added server | Mar 19, 2025 |
| View all files | | |
This 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.
This example shows how to:
Click the image above to watch a tutorial on MCP implementation.
.
├── pyproject.toml
├── README.md
├── src
│ ├── client
│ │ └── mcp_client.py # MCP client implementation
│ └── server
│ └── example_server.py # MCP server with tools
└── uv.lock
The server exposes two tools:
calculate_bmi
- A simple calculator that computes Body Mass Indexfetch_weather
- An async tool that retrieves weather data from an external APIThe client connects to the server via stdio, initializes a session, and calls the server's tools.
# Install dependencies
uv install -e .
uv run src/client/mcp_client.py
The client will:
Available tools: meta=None nextCursor=None tools=[...]
BMI calculation result: 22.857142857142858
Weather data: {"current_weather":{"temperature":14.2,"windspeed":12.6, ...}}
( run command below and then visit http://localhost:5173
)
❯ mcp dev src/server/example_server.py
Starting MCP inspector...
Proxy server listening on port 3000
🔍 MCP Inspector is up and running at http://localhost:5173 🚀
New SSE connection
Query parameters: {
transportType: 'stdio',
command: 'uv',
args: 'run --with mcp mcp run src/server/example_server.py',
This project uses:
This project is licensed under the MIT License - see the LICENSE file for details.
MCP CLIENT using python sdk.
No releases published
No packages published
You can’t perform that action at this time.