Skip to main content
Glama

MCP Project Query Server

by sweetwisdom
preview.js707 B
const path = require('path'); const { exec } = require('child_process'); // 获取当前目录下的 dist/index.cjs 的完整路径 const distPath = path.resolve(__dirname, 'dist', 'index.cjs'); console.log('⚠️:[ distPath ]🎈:', distPath) // 执行命令 const child = exec(`npx @modelcontextprotocol/inspector node '"${distPath}"'`); // 将子进程的输出重定向到父进程 child.stdout.on('data', (data) => { process.stdout.write(data); }); child.stderr.on('data', (data) => { process.stderr.write(data); }); child.on('close', (code) => { if (code !== 0) { console.error(`Command exited with code ${code}`); } else { console.log('Command executed successfully'); } });

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/sweetwisdom/mcp-demo'

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