Custom MCP Server
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., "@Custom MCP Servercalculate 25 * 4 + 15"
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.
Custom MCP Server 🤖
A Model Context Protocol (MCP) server built with Next.js, providing useful tools and utilities through both HTTP and Server-Sent Events (SSE) transports.
🚀 Features
🔧 Available Tools
echo - Echo any message back (perfect for testing)
get-current-time - Get the current timestamp and ISO date
calculate - Perform basic mathematical calculations safely
🌐 Transport Methods
HTTP Transport (
/mcp) - Stateless HTTP requests (works without Redis)SSE Transport (
/sse) - Server-Sent Events with Redis for state management
🔒 Security Features
Rate limiting (100 requests per minute)
Safe mathematical expression evaluation
Input sanitization and validation
Related MCP server: Vercel MCP Python Server
🏃♂️ Quick Start
Prerequisites
Node.js 18+
npm or yarn
Docker (optional, for local Redis)
Setup
Clone and install dependencies:
npm installRun the automated setup:
npm run setupThis will:
Create environment configuration
Set up Redis (Docker) if available
Start the development server automatically
Manual start (alternative):
npm run dev
The server will be available at http://localhost:3000
🧪 Testing
Quick Tests
# Test HTTP transport
npm run test:http
# Test SSE transport (requires Redis)
npm run test:sse
# Test with Claude Desktop protocol
npm run test:stdio
# Comprehensive tool testing
npm run test:toolsManual Testing
You can test the MCP server manually using curl:
# List available tools
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}'
# Call the echo tool
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "echo",
"arguments": {
"message": "Hello World!"
}
}
}'
# Calculate an expression
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "calculate",
"arguments": {
"expression": "15 * 4 + 10"
}
}
}'🔧 Configuration
Environment Variables
Create a .env.local file:
# Local Redis (Docker)
REDIS_URL=redis://localhost:6379
# Upstash Redis (Production)
UPSTASH_REDIS_REST_URL=your-upstash-url
UPSTASH_REDIS_REST_TOKEN=your-upstash-tokenRedis Setup
The server automatically detects and uses Redis in this priority order:
Upstash Redis (if
UPSTASH_REDIS_REST_URLandUPSTASH_REDIS_REST_TOKENare set)Local Redis (if
REDIS_URLis set)No Redis (HTTP transport only)
Local Redis with Docker
# The setup script handles this automatically, but you can also run manually:
docker run -d --name redis-mcp -p 6379:6379 redis:alpineUpstash Redis (Recommended for Production)
Create an Upstash Redis database at upstash.com
Add the connection details to your
.env.localThe server will automatically detect and use it
🖥️ Integration with AI Tools
Claude Desktop
Add to your Claude Desktop configuration (claude_desktop_config.json):
{
"mcpServers": {
"custom-mcp": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://localhost:3000/mcp"
]
}
}
}Configuration file locations:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Cursor IDE
For Cursor 0.48.0 or later (direct SSE support):
{
"mcpServers": {
"custom-mcp": {
"url": "http://localhost:3000/sse"
}
}
}For older Cursor versions:
{
"mcpServers": {
"custom-mcp": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"http://localhost:3000/mcp"
]
}
}
}🛠️ Development
Project Structure
custom-mcp-server/
├── app/
│ ├── [transport]/
│ │ └── route.ts # Main MCP server logic
│ ├── layout.tsx # Root layout
│ └── page.tsx # Home page
├── lib/
│ └── redis.ts # Redis utilities
├── scripts/
│ ├── setup.mjs # Automated setup
│ ├── test-http-client.mjs # HTTP transport tests
│ ├── test-sse-client.mjs # SSE transport tests
│ └── test-tools.mjs # Comprehensive tool tests
├── package.json
├── next.config.ts
└── README.mdAdding New Tools
Define the tool in
app/[transport]/route.ts:
const tools = {
// ... existing tools
myNewTool: {
name: "my-new-tool",
description: "Description of what your tool does",
inputSchema: {
type: "object",
properties: {
param1: {
type: "string",
description: "Description of parameter"
}
},
required: ["param1"]
}
}
};Add the handler:
const toolHandlers = {
// ... existing handlers
"my-new-tool": async ({ param1 }: { param1: string }) => {
// Your tool logic here
return {
content: [
{
type: "text",
text: `Result: ${param1}`
}
]
};
}
};Testing Your Changes
# Run all tests
npm run test:tools
# Test specific functionality
npm run test:http
npm run test:sse📝 API Reference
Tools/List
Get all available tools:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}Tools/Call
Call a specific tool:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "tool-name",
"arguments": {
"param": "value"
}
}
}🚀 Deployment
Vercel (Recommended)
Deploy to Vercel:
vercelAdd environment variables in Vercel dashboard:
UPSTASH_REDIS_REST_URLUPSTASH_REDIS_REST_TOKEN
Update your AI tool configurations to use the deployed URL:
https://your-app.vercel.app/mcp https://your-app.vercel.app/sse
Other Platforms
The server is a standard Next.js application and can be deployed to any platform that supports Node.js:
Netlify
Railway
Render
DigitalOcean App Platform
🤝 Contributing
Fork the repository
Create a feature branch:
git checkout -b feature/my-new-featureMake your changes and add tests
Run the test suite:
npm run test:toolsCommit your changes:
git commit -am 'Add some feature'Push to the branch:
git push origin feature/my-new-featureSubmit a pull request
📄 License
MIT License - see LICENSE file for details.
🆘 Troubleshooting
Common Issues
Server not starting:
Check if port 3000 is available
Ensure all dependencies are installed:
npm install
Redis connection issues:
Verify Docker is running:
docker psCheck Redis container status:
docker ps -a | grep redis-mcpRestart Redis:
docker restart redis-mcp
AI tool not detecting server:
Ensure the server is running and accessible
Check the configuration file syntax (valid JSON)
Restart your AI tool after configuration changes
Verify the server URL is correct
Tool calls failing:
Check server logs for error messages
Test tools manually with
npm run test:toolsVerify the tool parameters match the expected schema
Debug Mode
Enable debug logging by setting the environment variable:
DEBUG=1 npm run dev📞 Support
Create an issue on GitHub for bug reports
Check existing issues for common problems
Review the test scripts for usage examples
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityCmaintenanceAn MCP (Model Context Protocol) server implementation using HTTP SSE (Server-Sent Events) connections with built-in utility tools including echo, time, calculator, and weather query functionality.Last updated2
- Alicense-qualityDmaintenanceA 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.Last updatedMIT
- Flicense-qualityDmaintenanceA TypeScript MCP server implementation using Express.js that provides basic tools like echo, time retrieval, and calculator functionality. Features session management, RESTful API endpoints, and Server-Sent Events for streamable communication.Last updated
- Alicense-qualityDmaintenanceA self-contained, dependency-free MCP server that provides utility tools for time, date, mathematical calculations, and shell command execution. It supports remote connectivity through SSE and is designed for easy deployment via Docker.Last updatedGPL 3.0
Related MCP Connectors
Markdown-first MCP server for Notion API with 8 composite tools and 39 actions.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
MCP (Model Context Protocol) server for Appwrite
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Meerisha/custom-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server