Skip to main content
Glama

BMAD MCP Server

by Dali1789
bmad-mcp.jsโ€ข3.56 kB
#!/usr/bin/env node import fetch from 'node-fetch'; const RAILWAY_URL = process.env.BMAD_RAILWAY_URL || 'https://bmad-mcp-server-production.up.railway.app'; async function main() { const command = process.argv[2] || 'help'; try { switch (command) { case 'status': await getStatus(); break; case 'health': await getHealth(); break; case 'agents': await listAgents(); break; case 'activate': const agentId = process.argv[3]; if (!agentId) { console.error('Usage: bmad-mcp activate <agent-id>'); process.exit(1); } await activateAgent(agentId); break; case 'help': default: showHelp(); break; } } catch (error) { console.error('โŒ Error:', error.message); process.exit(1); } } async function getStatus() { console.log('๐Ÿ” Checking BMAD MCP Server status...'); const response = await fetch(`${RAILWAY_URL}/health`); if (!response.ok) { throw new Error(`Server returned ${response.status}`); } const data = await response.json(); console.log('โœ… Server Status:', JSON.stringify(data, null, 2)); } async function getHealth() { console.log('๐Ÿฅ Health check...'); const response = await fetch(`${RAILWAY_URL}/health`); if (!response.ok) { throw new Error(`Health check failed: ${response.status}`); } const data = await response.json(); console.log(`โœ… ${data.service} v${data.version} - ${data.status}`); console.log(`๐Ÿ“Š Active Agents: ${data.activeAgents}`); } async function listAgents() { console.log('๐Ÿ‘ฅ Listing available agents...'); const response = await fetch(`${RAILWAY_URL}/tools/call`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'list_agents', arguments: {} }) }); if (!response.ok) { throw new Error(`Failed to list agents: ${response.status}`); } const data = await response.json(); const result = JSON.parse(data.content[0].text); console.log('โœ… Available Agents:'); result.agents.forEach(agent => { const statusIcon = agent.status === 'active' ? '๐ŸŸข' : 'โšช'; console.log(` ${statusIcon} ${agent.id} (${agent.name}) - ${agent.title}`); }); } async function activateAgent(agentId) { console.log(`๐Ÿš€ Activating agent: ${agentId}...`); const response = await fetch(`${RAILWAY_URL}/tools/call`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'bmad_activate_agent', arguments: { agent_id: agentId } }) }); if (!response.ok) { throw new Error(`Failed to activate agent: ${response.status}`); } const data = await response.json(); const result = JSON.parse(data.content[0].text); if (result.success) { console.log(`โœ… Agent '${agentId}' activated successfully!`); } else { throw new Error(result.message || 'Activation failed'); } } function showHelp() { console.log(` ๐Ÿ—๏ธ BMAD MCP CLI v2.1.1 Usage: bmad-mcp <command> Commands: status Show server status and health health Quick health check agents List all available agents activate Activate an agent help Show this help message Examples: bmad-mcp status bmad-mcp agents bmad-mcp activate architect Environment Variables: BMAD_RAILWAY_URL Custom Railway deployment URL Default: ${RAILWAY_URL} `); } main().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/Dali1789/bmad-mcp-server'

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