MCP-Next.js
by sattarrasouli·★ 0·Score 30
A Next.js MCP server with TypeScript that exposes multiple simple tools like dice rolling and greetings via JSON-RPC API.
Overview
MCP-Next.js is a reference implementation of an MCP server built with Next.js and TypeScript. It demonstrates how to create and expose multiple interactive tools through a standardized JSON-RPC API. The server includes 8 different tools ranging from simple utilities like dice rolling and number generation to more creative features like random quotes and horoscopes. This implementation uses mcp-handler and @modelcontextprotocol/sdk to establish the MCP protocol interface, making it a good learning resource for developers looking to implement MCP servers.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Developers looking for a simple Next.js-based MCP server implementation example with TypeScript to understand MCP architecture.
When NOT to choose this
Production environments requiring robust error handling, authentication, and scalability beyond demonstration purposes.
Tools this server exposes
8 tools extracted from the READMEroll_diceRoll an N-sided die.
say_helloReturns a greeting message.
add_numbersAdds two numbers.
random_numberGenerates a random number between a given min and max.
random_quoteReturns a motivational quote.
emoji_reactionResponds with a random emoji.
color_paletteGenerates a random color palette.
horoscopeReturns a fun horoscope for a zodiac sign.
Comparable tools
Installation
# Clone the repository
git clone https://github.com/sattarrasouli/MCP-Next.js.git
cd MCP-Next.js
# Install dependencies
npm install
# Run the development server
npm run devThe MCP API will be available at http://localhost:3000/api/mcp.
**Claude Desktop Configuration:** Add to claude_desktop_config.json:
{
"mcpServers": {
"mcp-nextjs": {
"command": "npm",
"args": ["run", "dev"],
"env": {
"NODE_PATH": "."
}
}
}
}FAQ
- What MCP servers does this project implement?
- This project implements a simple MCP server with 8 tools: Roll Dice, Say Hello, Add Numbers, Random Number, Random Quote, Emoji Reaction, Color Palette, and Horoscope.
- How do I test the MCP tools?
- You can test the tools using either Postman or curl with JSON-RPC 2.0 format. The API endpoint is available at http://localhost:3000/api/mcp when running the development server.
Compare MCP-Next.js with
Last updated · Auto-generated from public README + GitHub signals.