Skip to main content
Glama

Cursor Admin MCP Server

by h3ro-dev
debug-api.ts•2.07 kB
#!/usr/bin/env tsx /** * Debug API responses */ import { CursorAdminClient } from '../src/cursor-client'; import dotenv from 'dotenv'; // Load environment variables dotenv.config(); async function debugAPI() { const apiKey = process.env.CURSOR_API_KEY; if (!apiKey) { console.error('āŒ Error: CURSOR_API_KEY environment variable is required'); process.exit(1); } console.log('šŸ” Debugging Cursor API responses...\n'); try { const client = new CursorAdminClient(apiKey); // Test 1: Get team members console.log('1. Testing GET /teams/members...'); try { const members = await client.getTeamMembers(); console.log('Response type:', typeof members); console.log('Response:', JSON.stringify(members, null, 2)); console.log('Is array?', Array.isArray(members)); console.log(''); } catch (error) { console.error('Error:', error); console.log(''); } // Test 2: Get usage data for last 7 days console.log('2. Testing POST /teams/daily-usage-data...'); try { const endDate = Date.now(); const startDate = endDate - (7 * 24 * 60 * 60 * 1000); const usageData = await client.getDailyUsageData(startDate, endDate); console.log('Response type:', typeof usageData); console.log('Response:', JSON.stringify(usageData, null, 2)); console.log('Is array?', Array.isArray(usageData)); console.log(''); } catch (error) { console.error('Error:', error); console.log(''); } // Test 3: Get spending data console.log('3. Testing POST /teams/spend...'); try { const spendingData = await client.getSpendingData(); console.log('Response type:', typeof spendingData); console.log('Response:', JSON.stringify(spendingData, null, 2)); console.log(''); } catch (error) { console.error('Error:', error); console.log(''); } } catch (error) { console.error('āŒ Fatal error:', error); process.exit(1); } } // Run the debug debugAPI();

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