Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Simple Serveradd 15 and 27"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Simple Server
A minimal, reference implementation of a Model Context Protocol server with streamable HTTP transport. Built with FastMCP following the official Anthropic MCP specification 2025-06-18. Perfect starting point for building remote MCP servers.
๐ฏ Purpose
This project serves as a simple, well-documented reference for developers who want to:
Build their first MCP server
Deploy MCP servers to cloud platforms (Railway, Heroku, Render)
Understand the MCP protocol implementation
Create a foundation for more sophisticated MCP solutions
Features
โ Two Math Tools:
addandmultiplyfunctionsโ Streamable HTTP Transport: Modern MCP protocol with SSE support
โ Session Management: Proper MCP initialization flow
โ Remote Deployment: Railway, Heroku, Render deployment configs
โ Automated Testing: Complete protocol validation and debugging tools
โ Claude Desktop Integration: Ready for AI assistant integration
โ Reference Implementation: Well-documented code for learning
Quick Start
Local Development
Server starts at: http://localhost:8000/mcp/
Test the Server
Expected output:
Available Tools
add(a, b)
Adds two numbers together.
Example:
multiply(a, b)
Multiplies two numbers together.
Example:
Manual Testing with curl
Local Testing (Development)
For testing your local development server running on localhost:8000:
1. Initialize Session
2. Send Initialized Notification
3. List Tools
4. Call Add Tool
Remote Testing (Production)
For testing your deployed server, replace localhost:8000 with your deployment URL:
Note: For comprehensive remote testing, use the automated test script:
Deployment
Railway (Recommended)
Push to GitHub:
git add . git commit -m "ready for deployment" git push origin mainDeploy to Railway:
Go to railway.app
Click "Deploy from GitHub repo"
Select your repository
Railway auto-detects Dockerfile and deploys
Test your deployment:
python test_deployment.py your-app-name.up.railway.appYour MCP URL:
https://your-app.railway.app/mcp/
Heroku
Your MCP URL: https://your-mcp-server.herokuapp.com/mcp/
Render
Connect GitHub repository to Render
Render auto-detects
render.yamland DockerfileDeploys automatically
Your MCP URL: https://your-service.onrender.com/mcp/
Docker
Claude Desktop Integration
Local Server Configuration
Remote Server Configuration (Recommended)
For remote servers deployed to Railway, Heroku, or Render, use the mcp-remote package:
Key Configuration Notes:
Use
npxwith the-yflag to auto-installmcp-remoteInclude the trailing slash in the URL:
/mcp/Add the
--allow-httpflag for HTTP connectionsInclude the Accept header for proper SSE support
Alternative: Direct Python Proxy (Advanced)
For advanced users or debugging purposes, you can create a custom Python proxy:
Note: This requires the claude_mcp_proxy.py script from the repository and is mainly for debugging purposes. Use mcp-remote for production.
Configuration File Locations:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Test with Claude
After integration, ask Claude:
"Can you add 42 and 18 for me?"
"What's 7 times 9?"
"What tools do you have available?"
Claude will use your MCP server to perform calculations! ๐
Development
Adding New Tools
Environment Variables
HOST: Server host (default: 127.0.0.1, use 0.0.0.0 for deployment)PORT: Server port (default: 8000, Railway sets this automatically)
Note: For Railway deployment, FastMCP will automatically bind to 0.0.0.0:$PORT.
Project Structure
Architecture
FastMCP: High-level MCP implementation from Anthropic
Streamable HTTP: Modern transport with SSE streaming support
Session Management: Stateful connections with session IDs
JSON-RPC 2.0: Standard protocol for message exchange
Protocol 2025-06-18: Latest MCP specification
Port 8000: Default FastMCP server port (configurable via PORT env var)
Technical Details
Server Implementation
Framework: FastMCP (official Anthropic library)
Transport: Streamable HTTP with Server-Sent Events
Protocol: MCP 2025-06-18 specification
Dependencies:
httpx>=0.28.1,mcp>=1.9.4
MCP Protocol Flow
Client sends
initializerequestServer responds with capabilities and session ID
Client sends
initializednotificationNormal operations begin (tools/list, tools/call, etc.)
Tool Response Format
Tools return simple Python values (float, int, str) which FastMCP automatically wraps in the proper MCP response format.
Troubleshooting
Server Won't Start
MCP Protocol Errors
Claude Desktop Not Connecting
Verify JSON configuration syntax - Use a JSON validator
Check server URL accessibility - Test with
curlor browserRestart Claude Desktop after config changes
Ensure proper MCP endpoint path - Use
/mcp/with trailing slashUse - Don't use
curlfor remote connections
Test Remote Deployment
Test your deployed server with the provided script:
This will run the complete MCP protocol test suite against your remote server.
Common Issues
Wrong endpoint: Use
/mcp/(with trailing slash)Missing headers: Include all required MCP headers
Session management: Must send
initializednotification afterinitializeRemote connections: Use
mcp-remote, notcurlfor Claude DesktopPort binding: Use
0.0.0.0:$PORTfor deployment, not127.0.0.1
Dependencies
The project uses:
mcp: Official Anthropic MCP Python SDK
httpx: Modern HTTP client for automated testing
Python: Requires Python >=3.10
Contributing
Fork the repository
Make your changes
Run tests:
python test_server.pyTest deployment:
python test_deployment.py your-test-urlEnsure all tests pass
Submit a pull request
License
MIT License