pjhaney2/mcp-server
If you are the rightful owner of mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The MCP Demo Server is a fully functional Model Context Protocol server implementation designed for both local development and remote deployment, featuring tools, prompts, and resources.
calculator_add
Add two numbers
calculator_subtract
Subtract two numbers
calculator_multiply
Multiply two numbers
calculator_divide
Divide two numbers
MCP Demo Server
A fully functional Model Context Protocol (MCP) server implementation with tools, prompts, and resources. Supports both local development and remote deployment on Google Cloud Run.
โจ Features
- ๐งฎ Calculator Tools: Basic math operations (add, subtract, multiply, divide)
- ๐ดโโ ๏ธ Pirate Talk Prompt: Transform text to pirate speak
- ๐ PDF Resource: Access to Waupaca draft report content
- ๐ง Local Development: MCP Inspector support for testing
- โ๏ธ Cloud Deployment: Ready for Google Cloud Run
- ๐ฏ Claude Integration: Works with Claude Desktop
๐ Project Structure
mcp-server-v2/
โโโ tools/
โ โโโ calculator.py # Clean calculator functions
โโโ prompts/
โ โโโ pirate_talk.py # Pirate talk prompt template
โโโ resources/
โ โโโ waupaca_report.pdf # PDF resource
โโโ server.py # Main MCP server (FastMCP)
โโโ config.py # Centralized configurations
โโโ requirements.txt # Python dependencies
โโโ Dockerfile # Container configuration
โโโ deploy.sh # Google Cloud Run deployment script
โโโ claude_config.json # Example Claude Desktop config
โโโ test_server.py # Server testing utility
โโโ run_inspector.sh # Inspector launcher script
โโโ README.md # This file
๐ Quick Start
Local Development
-
Set up environment:
python3 -m venv .venv source .venv/bin/activate pip install -r requirements.txt
-
Run the server:
# Activate virtual environment first source .venv/bin/activate # For MCP client connections (Claude Desktop) python server.py --stdio # For web-based inspector (debugging/testing) mcp dev server.py
-
Test with Inspector: The inspector provides a web interface where you can:
- Test calculator tools interactively
- Try pirate talk prompt transformations
- Access PDF resource content
- Debug server functionality
- Requires Node.js installed
โ๏ธ Cloud Deployment
Deploy to Google Cloud Run
-
Prerequisites:
# Install Google Cloud CLI if not already installed # Authenticate with your Google account gcloud auth login # Set your project gcloud config set project agents-460202
-
Deploy:
./deploy.sh
-
Live Server: https://mcp-server-613421470956.us-central1.run.app
Health Check
curl https://mcp-server-613421470956.us-central1.run.app/health
๐ Claude Desktop Integration
Option 1: Remote Server (Recommended)
Add this to your Claude Desktop claude_desktop_config.json
:
{
"mcpServers": {
"mcp-demo-server-remote": {
"transport": {
"type": "streamable-http",
"url": "https://mcp-server-613421470956.us-central1.run.app/mcp/"
}
}
}
}
Option 2: Local Development
For local testing with Claude Desktop:
{
"mcpServers": {
"mcp-demo-server": {
"command": "python",
"args": ["server.py", "--stdio"],
"cwd": "/Users/peterhaney/code/mcp-server-v2"
}
}
}
Claude Desktop config location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
๐ Available Tools & Resources
๐งฎ Calculator Tools
calculator_add(a, b)
- Add two numberscalculator_subtract(a, b)
- Subtract two numberscalculator_multiply(a, b)
- Multiply two numberscalculator_divide(a, b)
- Divide two numbers
Example: "Calculate 15 + 27" โ Uses calculator_add(15, 27)
โ Returns 42
๐ดโโ ๏ธ Pirate Talk Prompt
pirate_talk(text)
- Transform text to pirate speak
Example: "Hello, how are you?" โ "Ahoy there, matey! How be ye farin' on this fine day?"
๐ Waupaca Report Resource
waupaca://report
- Access full PDF content
Usage: "Show me the Waupaca report" โ Returns extracted PDF text content
โ๏ธ Configuration
All configurations are centralized in config.py
:
TOOL_CONFIGS
: Calculator tool definitions and schemasPROMPT_CONFIGS
: Pirate talk prompt templateRESOURCE_CONFIGS
: PDF resource configurationSERVER_CONFIG
: Server settings (name, version, host, port)
๐๏ธ Architecture
This implementation follows MCP best practices:
- Clean Separation: Tools are pure functions, MCP logic is separate
- Configuration-Driven: All tool/prompt/resource definitions in config files
- Modular Design: Easy to add new tools, prompts, or resources
- Dual Deployment: Supports both local (stdio) and remote (HTTP) transports
- Security: Includes middleware, headers, and proper error handling
- Scalable: Ready for serverless deployment on Google Cloud Run
๐ ๏ธ Technical Details
Dependencies
- FastMCP: Modern MCP server framework
- FastAPI/Starlette: Web framework for HTTP transport
- PyPDF2: PDF text extraction
- Uvicorn: ASGI server for production
Transport Types
- stdio: For local Claude Desktop integration
- streamable-http: For remote web deployment
Environment Variables
MCP_TRANSPORT
: Set tostreamable-http
for web deploymentPORT
: Server port (default: 8000)HOST
: Server host (default: 0.0.0.0)
๐งช Testing
Test server functionality:
source .venv/bin/activate
python test_server.py
Test specific endpoints:
# Health check
curl https://mcp-server-613421470956.us-central1.run.app/health
# Local testing
curl http://localhost:8000/health
๐ง Development Commands
# Run with stdio (for Claude Desktop)
python server.py --stdio
# Run with web server (for remote access)
python server.py --web
# Run with environment variable (Cloud Run style)
MCP_TRANSPORT=streamable-http python server.py
# Run inspector for testing
./run_inspector.sh
๐ Adding New Features
Add a New Tool
- Create function in
tools/
directory - Add configuration to
TOOL_CONFIGS
inconfig.py
- Register with
@mcp.tool()
decorator inserver.py
Add a New Prompt
- Create function in
prompts/
directory - Add configuration to
PROMPT_CONFIGS
inconfig.py
- Register with
@mcp.prompt()
decorator inserver.py
Add a New Resource
- Add file to
resources/
directory - Add configuration to
RESOURCE_CONFIGS
inconfig.py
- Register with
@mcp.resource()
decorator inserver.py
๐ฏ Success Criteria Met
โ
Three-folder structure (tools/, prompts/, resources/)
โ
Config-driven architecture (clean functions, centralized config)
โ
Local + Remote deployment (stdio + streamable-http)
โ
Google Cloud Run deployment (agents-460202 project)
โ
Claude Desktop integration (working remote connection)
โ
MCP Inspector support (local development testing)
โ
Production-ready (security, error handling, logging)
๐ Your MCP server is ready for production use with Claude Desktop!