
mcp with monad
使用 Next.js 实现的 MCP 服务器,提供前端界面与工具交互。
Repository Info
About This Server
使用 Next.js 实现的 MCP 服务器,提供前端界面与工具交互。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
MCP Server with Frontend Interface
A Next.js implementation of the Model Context Protocol (MCP) server with a frontend interface for interacting with MCP tools.
Features
- MCP server implementation using the
@modelcontextprotocol/sdk - Two client options:
- Standard MCP Client (uses Redis for communication)
- Direct API Client (bypasses Redis for more reliable testing)
- Sample tools: echo, time, calculate
- Redis connection status monitoring
Usage
Server Configuration
Update app/mcp.ts with your tools, prompts, and resources following the MCP TypeScript SDK documentation.
Running Locally
-
Install dependencies:
pnpm install -
Set up a Redis instance:
# Start Redis locally redis-server # Or configure a cloud Redis URL in .env echo "REDIS_URL=your_redis_url_here" > .env.local -
Start the development server:
pnpm dev -
Open http://localhost:3000 to access the frontend interface.
Client Options
Standard MCP Client
- Uses the full MCP protocol with Redis for communication
- Requires a working Redis connection
- Access at http://localhost:3000/mcp-client
Direct API Client
- Bypasses Redis and calls the MCP tools directly via API
- More reliable for testing but doesn't use the full MCP protocol
- Access at http://localhost:3000/direct-client
Troubleshooting
If you're experiencing timeout issues with the standard MCP client:
- Make sure Redis is running locally (
redis-server) - Check the Redis connection status on the home page
- Try the Direct API Client instead which bypasses Redis
- Check server logs for detailed error information
- Consider using a cloud Redis provider like Upstash
Notes for running on Vercel
- Requires a Redis attached to the project under
process.env.REDIS_URL - Make sure you have Fluid compute enabled for efficient execution
- After enabling Fluid compute, open
app/sse/route.tsand adjust max duration to 800 if you using a Vercel Pro or Enterprise account - Deploy the Next.js MCP template
Sample Command Line Client
script/test-client.mjs contains a sample client to try invocations via command line.
node scripts/test-client.mjs https://mcp-for-next-js.vercel.app
# mcp-with-monad
Quick Start
Clone the repository
git clone https://github.com/salimdev04/mcp-with-monadInstall dependencies
cd mcp-with-monad
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.