Skip to main content
Glama
debug-graphql-schema.js•2.29 kB
import { spawn } from 'child_process'; async function debugGraphQLSchema() { console.log('šŸš€ Starting MCP server...'); const server = spawn('bun', ['server.js'], { stdio: ['pipe', 'pipe', 'pipe'], cwd: process.cwd(), }); // Wait for server to be ready await new Promise((resolve, reject) => { const timeout = setTimeout(() => { reject(new Error('Server startup timeout')); }, 10000); server.stderr.on('data', (data) => { const output = data.toString(); if (output.includes('server started successfully')) { clearTimeout(timeout); resolve(); } }); server.on('error', (error) => { clearTimeout(timeout); reject(error); }); }); console.log('āœ… Server started successfully'); // Test GraphQL schema checker const problematicSchema = ` type User { id: ID! name: String! email: String! } type Query { users: [User!]! } `; const request = { jsonrpc: '2.0', id: 1, method: 'tools/call', params: { name: 'check_graphql_schema', arguments: { schema: problematicSchema, filename: 'test.graphql', strict: true, limit: 10 }, }, }; const response = await new Promise((resolve, reject) => { const timeout = setTimeout(() => { reject(new Error('Request timeout')); }, 15000); const responseHandler = (data) => { clearTimeout(timeout); try { const response = JSON.parse(data.toString()); resolve(response); } catch (error) { console.log('Raw response:', data.toString()); reject(new Error('Invalid JSON response: ' + error.message)); } }; server.stdout.once('data', responseHandler); server.stdin.write(JSON.stringify(request) + '\n'); }); console.log('šŸ“Š Full Response:'); console.log(JSON.stringify(response, null, 2)); if (response.result && response.result.content) { console.log('\nšŸ” Content Analysis:'); response.result.content.forEach((item, index) => { console.log(`Content ${index}:`, item.text.substring(0, 200) + '...'); }); } server.kill(); console.log('\nšŸ›‘ Server stopped'); } debugGraphQLSchema().catch(console.error);

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/moikas-code/moidvk'

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