Build and use your custom MCP (Model Context Protocol) servers
创建于 3/29/2026
更新于 about 7 hours ago
README
Repository documentation and setup instructions
MCP Server Project
A simple project demonstrating how to build and use MCP (Model Context Protocol) servers.
Quick Start
- Install dependencies:
pip install -r requirements.txt
- Configure MCP server in Windsurf/Claude Desktop:
{
"mcpServers": {
"github": {
"command": "python",
"args": ["/path/to/server/github.py"],
"env": {
"GITHUB_TOKEN": "your_github_token_here (see .env.example)"
}
},
"database": {
"command": "python",
"args": ["/path/to/server/database.py"]
}
}
}
- Use with LLM:
- Start Windsurf/Claude Desktop
- Ask: "Show me octocat's repositories"
- LLM will automatically call the MCP server tools
🚀 Live Deployment
This MCP server is deployed and available for testing at:
- URL:
https://my-mcp.fastmcp.app/mcp - Status: Production ready
Using the Deployed Server
Configure Windsurf to use the deployed endpoint:
{
"mcpServers": {
"github-mcp-deployed": {
"url": "https://my-mcp.fastmcp.app/mcp",
"disabled": false
}
}
}
Test the deployed server:
- Ask any LLM with MCP support: "Show me repositories for gn1264"
- The deployed server will respond with GitHub data
Benefits of Deployed Server
- ✅ No local Python environment required
- ✅ Always available and reliable
- ✅ Managed infrastructure
- ✅ Same functionality as local version
Testing (Optional)
For development and testing:
# Test GitHub server
python testing/test_github_server.py get-repos octocat
# Test Database server
python testing/test_database_server.py query "SELECT * FROM users"
Project Structure
mcp/
├── server/ # MCP servers
│ ├── github.py # GitHub API server
│ └── database.py # Database server
├── client/ # Real LLM client
│ └── mcp_client.py # LLM integration example
├── testing/ # Server testing utilities
│ ├── test_github_server.py # Test GitHub server
│ └── test_database_server.py # Test Database server
├── simple.db # Sample database file
├── requirements.txt # Dependencies
├── README.md # This file
└── learn.md # Learning guide
MCP Servers
Both servers are independent and demonstrate different use cases:
GitHub Server (server/github.py)
- Purpose: Demonstrates how GitHub MCP servers work in the market
- Use Case: Public GitHub API access for general users
- Tools: GitHub API operations (get repos, commits, search, etc.)
- Similar to: Commercial GitHub MCP integrations
Database Server (server/database.py)
- Purpose: Shows enterprise database integration patterns
- Use Case: Internal database access in enterprise environments
- Tools: SQL query execution
- Similar to: Custom internal MCP servers for company data
Testing vs Real Usage
Testing Utilities (testing/)
- Direct tool calls to test server functionality
- Manual tool selection
LLM Client (client/mcp_client.py)
- Real MCP usage with LLM integration
- Dynamic tool selection
Learning
See learn.md for detailed explanations of MCP concepts and how this project works.
快速设置
此服务器的安装指南
安装包 (如果需要)
uvx mcp
Cursor 配置 (mcp.json)
{
"mcpServers": {
"alokverma18-mcp": {
"command": "uvx",
"args": [
"mcp"
]
}
}
}