Skip to main content
Glama
mednabouli

MCP Multi-Context Hook Generator

by mednabouli
graphql.ts913 B
import fs from 'fs'; import path from 'path'; import glob from 'glob'; interface GraphQLOperation { name: string; type: 'query' | 'mutation'; variablesType: string; responseType: string; } export function crawlGraphQL(rootPath: string): GraphQLOperation[] { const files = glob.sync('**/*.{graphql,gql}', { cwd: rootPath }); const ops: GraphQLOperation[] = []; files.forEach((file: any) => { const content = fs.readFileSync(path.join(rootPath, file), 'utf-8'); const matches = [...content.matchAll(/(query|mutation)\s+(\w+)\s*(\([^\)]*\))?/g)]; matches.forEach((m) => { const type = m[1] as 'query' | 'mutation'; const name = m[2]; const varsRaw = m[3] || ''; const variablesType = varsRaw ? `${name}Variables` : 'void'; const responseType = `${name}Response`; ops.push({ name, type, variablesType, responseType }); }); }); return ops; }

Latest Blog Posts

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/mednabouli/MCPV2'

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