Skip to main content
Glama

Cursor Admin MCP Server

by h3ro-dev
test-connection.ts•1.75 kB
#!/usr/bin/env tsx /** * Test connection to Cursor API * Usage: npm run dev examples/test-connection.ts */ import { CursorAdminClient } from '../src/cursor-client'; import dotenv from 'dotenv'; // Load environment variables dotenv.config(); async function testConnection() { const apiKey = process.env.CURSOR_API_KEY; if (!apiKey) { console.error('āŒ Error: CURSOR_API_KEY environment variable is required'); console.error('Please set it in your .env file'); process.exit(1); } console.log('šŸ” Testing connection to Cursor API...\n'); try { const client = new CursorAdminClient(apiKey); // Test connection console.log('Testing API connection...'); const isConnected = await client.testConnection(); if (isConnected) { console.log('āœ… Successfully connected to Cursor API!\n'); // Get team members console.log('šŸ“‹ Fetching team members...'); const members = await client.getTeamMembers(); console.log(`Found ${members.length} team members:`); members.forEach((member, index) => { console.log(` ${index + 1}. ${member.name} (${member.email}) - ${member.role}`); }); console.log('\n✨ All tests passed! Your API key is valid and working.'); } } catch (error) { console.error('āŒ Connection test failed:', error); if (error instanceof Error && error.message.includes('Invalid API key')) { console.error('\nšŸ’” Please check that:'); console.error(' 1. Your API key is correct'); console.error(' 2. You have admin access to the team'); console.error(' 3. The API key hasn\'t been revoked'); } process.exit(1); } } // Run the test testConnection();

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