A Model Context Protocol (MCP) server that provides Wikipedia information access through Vercel's serverless functions.
This MCP server provides the following tools:
- search_wikipedia - Search Wikipedia for articles matching a query
- get_article - Get the full content of a Wikipedia article
- get_summary - Get a concise summary of a Wikipedia article
- get_sections - Get the sections of a Wikipedia article
- get_coordinates - Get the geographic coordinates of a Wikipedia article
- get_related_topics - Get topics related to a Wikipedia article
All tools support multi-language Wikipedia by specifying a language code (e.g., 'en', 'es', 'fr', 'ja', 'zh').
- Node.js 18.x or later
- npm or yarn
- A Vercel account (free tier works fine)
-
Install dependencies:
npm install
-
Run the development server:
npm run dev
-
Test the MCP server:
The MCP endpoint will be available at
http://localhost:3000/api/mcp -
Test with MCP Inspector:
npx @modelcontextprotocol/inspector@latest http://localhost:3000
Then:
- Open
http://127.0.0.1:6274in your browser - Select "Streamable HTTP" from the dropdown
- Enter
http://localhost:3000/api/mcpas the URL - Click "Connect"
- Test the tools under the "Tools" section
- Open
-
Install Vercel CLI (if not already installed):
npm i -g vercel
-
Deploy to Vercel:
vercel
-
Follow the prompts:
- Link to an existing project or create a new one
- Confirm the settings
- Deploy!
-
Deploy to production:
vercel --prod
-
Push your code to GitHub:
git init git add . git commit -m "Initial commit" git branch -M main git remote add origin <your-github-repo-url> git push -u origin main
-
Connect to Vercel:
- Go to vercel.com
- Click "Add New Project"
- Import your GitHub repository
- Vercel will auto-detect Next.js and configure everything
- Click "Deploy"
-
Create a new project in Vercel:
- Go to vercel.com/new
- Import your Git repository or upload your project
-
Configure the project:
- Framework Preset: Next.js
- Root Directory:
./ - Build Command:
next build - Output Directory:
.next
-
Deploy!
After deployment, you'll get a URL like https://your-project.vercel.app
Add this to your Claude Desktop configuration file:
Location of config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
Configuration:
{
"mcpServers": {
"wikipedia": {
"url": "https://your-project.vercel.app/api/mcp"
}
}
}Add to .cursor/mcp.json:
{
"mcpServers": {
"wikipedia": {
"url": "https://your-project.vercel.app/api/mcp"
}
}
}Add to mcp_config.json:
{
"mcpServers": {
"wikipedia": {
"serverUrl": "https://your-project.vercel.app/api/mcp"
}
}
}Once connected, you can ask your AI assistant:
- "Search Wikipedia for information about quantum computing"
- "Get me a summary of the article about Claude Shannon"
- "What are the geographic coordinates of Mount Everest?"
- "Find related topics to artificial intelligence on Wikipedia"
- "Search Japanese Wikipedia for information about Tokyo" (the server will handle the language parameter)
- GET/POST/DELETE
/api/mcp- Main MCP endpoint - GET
/- Info page about available tools
query(string, required): The search termlimit(number, optional): Maximum results (1-50, default: 10)language(string, optional): Wikipedia language code (default: 'en')
title(string, required): Article titlelanguage(string, optional): Wikipedia language code (default: 'en')
title(string, required): Article titlelanguage(string, optional): Wikipedia language code (default: 'en')
title(string, required): Article titlelanguage(string, optional): Wikipedia language code (default: 'en')
title(string, required): Article titlelanguage(string, optional): Wikipedia language code (default: 'en')
title(string, required): Article titlelimit(number, optional): Maximum results (1-50, default: 10)language(string, optional): Wikipedia language code (default: 'en')
This MCP server is built using:
- Next.js 15 - React framework for production
- mcp-handler - Official MCP handler package for Vercel
- Wikipedia API - MediaWiki Action API for Wikipedia data
- Vercel Functions - Serverless functions with Fluid Compute
The server leverages Vercel's Fluid Compute features:
- Optimized Concurrency - Efficient request handling
- Dynamic Scaling - Scales based on demand
- Minimal Idle Time - Pay only for what you use
- Verify your MCP endpoint URL is correct:
https://your-project.vercel.app/api/mcp - Check that the deployment is successful in Vercel dashboard
- Try accessing the root URL to see if the server is running
- Restart your MCP client (Claude Desktop, Cursor, etc.)
- Check the MCP client logs for connection errors
- Verify the configuration file syntax is correct
- Most errors are due to incorrect article titles (they're case-sensitive)
- Some articles may not exist in the specified language
- Rate limiting may occur with excessive requests
Contributions are welcome! Please feel free to submit issues or pull requests.
MIT License - feel free to use this in your own projects!
Based on the wikipedia-mcp Python implementation by Rudra-ravi, adapted for Vercel deployment using TypeScript and the mcp-handler package.