MCP Server for Cursor
MCP Server for Cursor
A Model Context Protocol (MCP) server implementation for Cursor IDE integration, providing a modern web dashboard and tools through SSE (Server-Sent Events) and WebSocket connections.
Features
- Real-time connection monitoring with WebSocket support
- Modern web dashboard for server management
- SSE-based communication with Cursor IDE
- Built-in test tool for verifying connectivity
- Google Drive integration for file management
- Extensible architecture for adding new tools
- Connection history visualization
- Client management interface
- Service configuration UI
- Customizable server settings
Prerequisites
- Python 3.8 or higher
- Node.js 18 or higher
- npm (Node.js package manager)
- pip (Python package manager)
- Cursor IDE
Installation
- Clone the repository:
- Install dependencies:
Development
Start the development servers:
The servers will start at:
- Backend:
http://localhost:8765
- Frontend:
http://localhost:3000
(or3001
if port 3000 is in use)
You can also start the servers separately:
The development servers provide:
- Hot reloading for frontend changes
- Automatic proxy of API requests to the backend
- WebSocket connection handling
- Concurrent backend and frontend development
If you're running other applications that use port 3000, the frontend will automatically try port 3001 and increment until it finds an available port. The actual URL will be displayed in the terminal when you run npm run dev
.
Project Structure
Available Endpoints
HTTP Endpoints
/api/status
- Get server status/api/connections/history
- Get connection history/api/clients
- Get active clients/api/services/{service_id}
- Service configuration/api/settings
- Server settings
WebSocket Endpoint
/ws/{client_id}
- Real-time updates and ping/pong
SSE Endpoint
/sse
- Server-Sent Events for Cursor IDE
Tool Endpoints
/invoke/test
- Test tool/invoke/google_drive
- Google Drive operations
Production Deployment
Build and start the production server:
Configuration
Initial Setup
- Copy the template configuration:
- Update
services_config.json
with your service credentials:- For Google Drive:
- Create a project in Google Cloud Console
- Enable the Google Drive API
- Create OAuth 2.0 credentials
- Add your
client_id
andclient_secret
- For Google Drive:
Server Settings
Configure server settings through the web dashboard:
- Debug mode
- SSL settings
- Connection limits
- Ping timeout
- Protocol settings
Testing
Test the server using the provided test client:
The test client will:
- Connect to both SSE and WebSocket endpoints
- Send periodic pings
- Test available tools
- Monitor connection status
Troubleshooting
- Connection Issues
- Check both backend and frontend logs
- Verify the WebSocket connection in browser DevTools
- Ensure the proxy settings in
vite.config.ts
are correct - Check for port conflicts
- Frontend Issues
- Clear browser cache
- Check browser console for errors
- Verify Node.js and npm versions
- Check for TypeScript compilation errors
- Backend Issues
- Check
mcp_server.log
for errors - Verify Python dependencies are installed
- Check port availability
- Ensure service configurations are valid
- Check
Security Notes
- The server accepts all origins (CORS
*
) in development - WebSocket connections use client IDs for basic identification
- Service credentials are stored in
services_config.json
- Environment variables should be used for sensitive data in production
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests
- Submit a pull request
License
[Add your license information here]
This server cannot be installed
A Model Context Protocol server that integrates with Cursor IDE, providing real-time communication, modern web dashboards, and extensible tools via SSE and WebSocket connections.