nextjs-mcp-server
1
This project is a Motion Control Protocol (MCP) server implemented using Next.js. It supports real-time communication through Server-Sent Events and provides a JSON-RPC compliant API for tool invocation. It is designed to integrate with Cursor as an external tool provider.
Next.js MCP Server
A Motion Control Protocol (MCP) server implementation using Next.js.
Features
- Server-Sent Events (SSE) for real-time communication
- JSON-RPC compliant API for tool invocation
- House exploration example with rooms, items, and resources
- Compatible with Cursor's MCP requirements
Getting Started
- Install dependencies
- Run the development server
Connecting with Cursor
- Make sure your server is running
- In Cursor, go to Settings > Tools > Motion Control Protocol
- Add a new MCP server with the provided URL
Available Tools
house.getDetails
- Get general information about the househouse.getRooms
- List all rooms (basic info)house.getRoom
- Get details about a specific roomgetPassword
- Get the password for accessing room 5resources.list
- List all available resourcesresources.get
- Get a specific resource by ID
Implementation Details
This MCP server is based on Next.js App Router and uses:
- API Routes for JSON-RPC endpoints
- Server-Sent Events for real-time communication
- Next.js streaming responses
- TypeScript for type safety