Skip to main content
Glama

Cursor Admin MCP Server

by h3ro-dev
PROJECT_SUMMARY.mdโ€ข5.18 kB
# Cursor Admin MCP Server - Project Summary ## โœ… What We Built A fully functional Model Context Protocol (MCP) server for the Cursor Admin API that enables AI assistants to: - Manage Cursor teams - Analyze usage data and metrics - Track spending and costs - Generate reports and insights ## ๐Ÿ“ Repository Structure ``` cursor-admin-mcp/ โ”œโ”€โ”€ src/ โ”‚ โ”œโ”€โ”€ index.ts # MCP server implementation โ”‚ โ””โ”€โ”€ cursor-client.ts # Cursor API client with full type safety โ”œโ”€โ”€ tests/ โ”‚ โ””โ”€โ”€ cursor-client.test.ts # Comprehensive test suite (14 tests, 100% passing) โ”œโ”€โ”€ examples/ โ”‚ โ”œโ”€โ”€ test-connection.ts # API connection tester โ”‚ โ”œโ”€โ”€ usage-report.ts # Generate usage reports โ”‚ โ””โ”€โ”€ spending-analysis.ts # Analyze team spending โ”œโ”€โ”€ docs/ โ”‚ โ””โ”€โ”€ cursor-integration.md # Detailed integration guide โ”œโ”€โ”€ dist/ # Built JavaScript files โ”œโ”€โ”€ package.json # NPM configuration โ”œโ”€โ”€ tsconfig.json # TypeScript configuration โ”œโ”€โ”€ jest.config.js # Jest test configuration โ”œโ”€โ”€ .env.example # Environment template โ”œโ”€โ”€ .gitignore # Git ignore rules โ”œโ”€โ”€ .eslintrc.json # ESLint configuration โ”œโ”€โ”€ .prettierrc # Prettier configuration โ”œโ”€โ”€ setup.sh # Automated setup script โ”œโ”€โ”€ test-server.sh # Server testing script โ”œโ”€โ”€ README.md # Comprehensive documentation โ”œโ”€โ”€ LICENSE # MIT License โ”œโ”€โ”€ INSTALLATION.md # Installation guide โ””โ”€โ”€ PROJECT_SUMMARY.md # This file ``` ## ๐Ÿš€ Key Features Implemented ### 1. **Complete API Coverage** - โœ… Get team members (names, emails, roles) - โœ… Get daily usage data (lines added/deleted, AI acceptance rates, model usage) - โœ… Get spending data (with filtering, sorting, pagination) ### 2. **Production-Ready Code** - โœ… Full TypeScript implementation - โœ… Zod validation for all inputs - โœ… Comprehensive error handling - โœ… Axios interceptors for API communication - โœ… Environment variable configuration ### 3. **Testing & Quality** - โœ… Jest test suite with 14 tests - โœ… 100% test pass rate - โœ… Mock-based testing for API calls - โœ… ESLint and Prettier configured - โœ… TypeScript strict mode ### 4. **Developer Experience** - โœ… Easy setup script (`./setup.sh`) - โœ… Example scripts for all use cases - โœ… Detailed documentation - โœ… Clear error messages - โœ… Type safety throughout ### 5. **Security** - โœ… API key via environment variables - โœ… Basic authentication implementation - โœ… No credentials in code - โœ… Secure error handling ## ๐Ÿ› ๏ธ Technologies Used - **TypeScript** - Type-safe implementation - **@modelcontextprotocol/sdk** - MCP protocol implementation - **Axios** - HTTP client with interceptors - **Zod** - Runtime type validation - **Jest** - Testing framework - **Node.js** - Runtime environment ## ๐Ÿ“Š API Endpoints Implemented 1. **GET /teams/members** - Returns team member list - No parameters required 2. **POST /teams/daily-usage-data** - Parameters: startDate, endDate (epoch ms) - 90-day limit validation - Returns detailed usage metrics 3. **POST /teams/spend** - Optional parameters: searchTerm, sortBy, sortDirection, page, pageSize - Returns spending data with pagination ## ๐Ÿงช Testing Results ``` PASS tests/cursor-client.test.ts โœ“ All 14 tests passing โœ“ Constructor validation โœ“ API calls with mocked responses โœ“ Error handling scenarios โœ“ Date validation logic โœ“ Connection testing ``` ## ๐Ÿ“ Documentation Created 1. **README.md** - Complete project documentation 2. **INSTALLATION.md** - Step-by-step installation guide 3. **cursor-integration.md** - Cursor-specific integration 4. **API documentation** - Inline JSDoc comments 5. **Example scripts** - Working code examples ## ๐ŸŽฏ Usage in AI Assistants Once configured, the MCP server enables natural language queries: ``` "Show me all team members" "What was our AI acceptance rate last week?" "Who are the top spenders this month?" "Generate a usage report for January" "Compare this week's productivity to last week" ``` ## ๐Ÿ”ง Configuration The server requires only one environment variable: ```env CURSOR_API_KEY=key_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ``` ## ๐Ÿšฆ Project Status โœ… **COMPLETE** - The project is fully functional and ready for: - Local development use - Integration with Claude Code - Integration with Cursor - NPM publication - Open-source sharing ## ๐Ÿ“ฆ Next Steps to Publish 1. Create GitHub repository 2. Push code to GitHub 3. Add GitHub Actions for CI/CD 4. Publish to NPM registry 5. Create documentation website ## ๐ŸŽ‰ Summary We've successfully created a complete, production-ready MCP server for the Cursor Admin API with: - Full API coverage - Comprehensive testing - Excellent documentation - Easy installation - Type safety - Error handling - Security best practices The server is ready to be used locally or published for the broader community!

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/h3ro-dev/cursor-admin-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server