https://github.com/josx/mcp_demo
Demo: mcp protocol with simple client and server file
https://github.com/josx/mcp_demo
Last synced: 28 days ago
JSON representation
Demo: mcp protocol with simple client and server file
- Host: GitHub
- URL: https://github.com/josx/mcp_demo
- Owner: josx
- License: apache-2.0
- Created: 2025-04-04T18:25:26.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-04-08T19:58:19.000Z (8 months ago)
- Last Synced: 2025-04-10T22:48:29.905Z (8 months ago)
- Language: Python
- Size: 10.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-mcp-servers - **mcp_demo** - Demo: mcp protocol with simple client and server file `python` `mcp` `server` `pip install git+https://github.com/josx/mcp_demo` (🤖 AI/ML)
README
# Demo MCP
## Info
- Server - Using server examples from [modelcontextprotocol/python-sdk](https://github.com/modelcontextprotocol/python-sdk)
- Client - Using code from [slavashvets/mcp-http-client-example](https://github.com/slavashvets/mcp-http-client-example/)
- Debug - Using [Inspector](https://github.com/modelcontextprotocol/inspector)
## Setup
```bash
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
```
## Run Server
> You can use any of this two servers
- `python server.py` or with jwt auth `python server_asgi.py`
## Run demo client
- `python client.py http://localhost:8000/sse`
## Run demo host (langchain/langgraph)
> You need to run ollama and download a model
- `python host_langchain.py llama3.3 http://localhost:11434`
## Debug
> You can debug server with this app
- Open a new terminal and run `npx @modelcontextprotocol/inspector`
- Point browser to http://127.0.0.1:6274
- Change Transport Type to `SSE`
- Change URL to `http://localhost:8000/sse`
- Press `Connect` and start testing server