GitHub Stars
1
User Rating
Not Rated
Favorites
0
Views
72
Forks
0
Issues
0
๐ Complete MCP (Model Context Protocol) Demo Project
By Yassine FARAH
This project demonstrates a full-stack implementation of the Model Context Protocol (MCP), a standardized way to connect LLMs to external data, tools, and services โ think of it like USB-C for AI apps.
๐ฆ Project Overview
Youโll build and compare:
โ
A Python MCP Server
โ
A TypeScript MCP Server
โ
Integration with the Claude Desktop app
โ
Real-time access to:
- Notes
- Todos
- Weather
- GitHub search
- File system
- System info
โ๏ธ Prerequisites
- โ Python 3.8+
- โ Node.js 18+
- โ Git
- โ Claude Desktop (https://claude.ai/download)
- โ Basic knowledge of Python & TypeScript
๐งฑ Project Structure
mcp-demo-project/
โโโ python-server/ # Python MCP server
โโโ typescript-server/ # TypeScript MCP server
โโโ config/ # MCP config files
โโโ examples/ # Optional examples/demos
โโโ README.md # ๐ You are here
text
๐ Python MCP Server Setup
Step 1: Environment Setup
cd python-server
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
Step 2: Run the Server
bash
python server.py
Or use the launch helper:
python run_server.py
๐งฉ TypeScript MCP Server Setup
Step 1: Initialize Project
cd typescript-server
npm install
npm run build
Step 2: Run Server
bash
npm start
For hot reload (dev mode):
```bash
npm run dev
๐ค Claude Desktop Integration
Add this config in:
Windows: %APPDATA%\Claude\claude_desktop_config.json
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
json
{
"mcpServers": {
"python-demo": {
"command": "python",
"args": ["absolute/path/to/python-server/server.py"]
},
"typescript-demo": {
"command": "node",
"args": ["absolute/path/to/typescript-server/dist/server.js"]
}
}
}
Restart Claude Desktop
MCP servers should now be auto-connected. You can start asking:
"Add a note with title 'Test'"
"List all notes"
"What's the weather in Casablanca?"
"Search GitHub for 'LLM server'"
"Add a todo: Finish MCP project"
"List todos"
๐ Deployment
Dockerfile (Python server)
dockerfile
FROM python:3.11-slim
WORKDIR /app
COPY python-server/requirements.txt .
RUN pip install -r requirements.txt
COPY python-server/ .
CMD ["python", "server.py"]
Docker Compose (Optional)
yaml
services:
python-mcp:
build: .
volumes:
- ./data:/app/data
stdin_open: true
tty: true
๐งช Testing & Debugging
Test direct:
bash
echo '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {}}' | python server.py
bash
echo '{"jsonrpc": "2.0", "id": 1, "method": "initialize", "params": {}}' | npm start
๐ Advanced Features
โ
SQLite support (pip install sqlite3)
โ File system browsing
โ GitHub search via API
โ Weather info (mocked)
โ Modular Tool and Resource structure
๐ง Next Steps
Add real authentication (e.g. for GitHub API)
Build more tools (PDF parser, calendar, translator, etc.)
Streamline for production using Docker/Kubernetes
Implement real-time streaming + WebSocket support
Connect to your business or LLM product
๐ Resources
๐ MCP Spec
๐ Python SDK
๐งโ๐ป TypeScript SDK
๐งช Example Servers