
Vercel MCP Python Server
A serverless MCP server deployed on Vercel that provides basic utility tools including echo, time retrieval, arithmetic operations, and mock weather information. Includes an interactive client application for testing and demonstration purposes.
README
Vercel MCP Python Server
A Model Context Protocol (MCP) server built with Python and FastMCP, designed to run on Vercel's serverless platform.
Project Structure
vercel-mcp-python/
├── api/
│ └── index.py # Main Vercel function
├── src/
│ └── mcp_server.py # Your MCP server logic
├── client-app/ # Interactive MCP client
│ ├── mcp_client.py # Rich client application
│ ├── requirements.txt # Client dependencies
│ ├── setup.py # Setup script
│ ├── README.md # Client documentation
│ └── run_client.bat # Windows launcher
├── requirements.txt # Server dependencies
├── vercel.json # Vercel configuration
└── README.md
Features
This MCP server provides the following tools:
- echo: Echo back a provided message
- get_time: Get the current server time
- add_numbers: Add two numbers together
- get_weather_info: Get mock weather information for a location
And the following resources:
- config://server: Server configuration information
Prerequisites
Before setting up the project, you'll need to install the Vercel CLI:
Installing Vercel CLI
For Git Bash on Windows:
-
Install Node.js (if not already installed):
- Download from nodejs.org
-
Install Vercel CLI globally:
npm install -g vercel
-
Verify installation:
vercel --version
If you encounter PATH issues:
# Find npm global directory
npm config get prefix
# Add to PATH (add this to your ~/.bashrc)
export PATH=$PATH:$(npm bin -g)
source ~/.bashrc
Alternative methods:
# Using npx (no global installation)
npx vercel
# Using yarn
yarn global add vercel
Setup
-
Create and activate virtual environment (Recommended):
# Create virtual environment python -m venv venv # Activate virtual environment # On Windows PowerShell: .\venv\Scripts\Activate.ps1 # On Windows Git Bash: source venv/Scripts/activate # On macOS/Linux: source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Login to Vercel:
vercel login
-
Deploy to Vercel:
vercel --prod
Local Development
To test locally, you can use Vercel's development server:
vercel dev
Troubleshooting Windows Issues
Note: Local development with vercel dev
may have issues on Windows due to runtime initialization errors. This is a known limitation and doesn't affect production deployment.
If you encounter issues with vercel dev
:
Solution 1: Deploy directly (Recommended)
vercel --prod
Your server will be available at the provided Vercel URL and works perfectly in production.
Solution 2: Test locally with Python (in virtual environment)
# Activate virtual environment first
.\venv\Scripts\Activate.ps1 # Windows PowerShell
# or
source venv/Scripts/activate # Windows Git Bash
# Test MCP server functionality
python -c "
import sys, os
sys.path.append('src')
from mcp_server import mcp
import json
# Test echo tool
request = {
'jsonrpc': '2.0',
'id': 1,
'method': 'tools/call',
'params': {'name': 'echo', 'arguments': {'message': 'Hello from venv!'}}
}
response = mcp.handle_request(request)
print(json.dumps(response, indent=2))
"
Solution 3: Use the deployed version Your server will be available at your Vercel domain after deployment.
You can test it by:
- Opening the URL in your browser
- Using a tool like Postman or curl
- Connecting with an MCP client
Solution 4: Run as Administrator (if needed)
- Close your terminal
- Right-click on Git Bash/PowerShell and select "Run as administrator"
- Navigate back to your project:
cd /d/repos/vercel-mcp-python
- Try
vercel dev
again
API Endpoints
GET /
: Returns server information and statusPOST /
: Handles MCP protocol requestsOPTIONS /
: Handles CORS preflight requests
Dependencies
fastmcp>=0.15.0
: FastMCP framework for building MCP serversuvicorn>=0.24.0
: ASGI server for Python web applicationspython-json-logger>=2.0.0
: JSON logging for Python applications
Configuration
The server is configured through vercel.json
with:
- Python runtime using
@vercel/python
- 30-second maximum execution time
- CORS enabled for cross-origin requests
- Automatic routing to the main handler
Usage
Once deployed, your MCP server will be available at your Vercel domain. You can connect to it using any MCP-compatible client.
Using the Included Client App
A rich, interactive client application is included in the client-app/
directory:
# Navigate to client directory
cd client-app
# Setup (first time only)
python setup.py
# Configure environment (optional)
cp .env.example .env
# Edit .env to customize server URL and settings
# Run the client
python mcp_client.py
The client provides:
- 🔌 Connection testing
- 🔧 Interactive tool calling
- 📚 Resource management
- 🧪 Automated testing of all tools
- 🎨 Beautiful console interface
See client-app/README.md
for detailed usage instructions.
Additional Resources
- Vercel MCP Documentation - Official Vercel documentation for Model Context Protocol
- MCP Servers Repository - Explore available MCP servers
- AI SDK Documentation - Use the AI SDK to initialize MCP clients
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.