{
  "markdown": "# MCP Generator\n\nGenerate minimal MCP servers for Rocket.Chat with only the tools your project needs. Reduces context bloat by 80-95%.\n\n## The Problem\n\nExisting MCP servers expose all 547 Rocket.Chat API endpoints, burning ~115k tokens per agent loop. Most projects need 2-10 tools. Every unused tool definition wastes tokens and money on every agentic iteration.\n\n## The Solution\n\nThis generator produces production-ready MCP servers covering **only** the workflows you select. Generated tools contain real decision logic — not thin API wrappers.\n\n## Quick Start\n\n```bash\nnpm install\nnpx tsx src/index.ts generate --capabilities \"onboard new team members\" --output ./my-server\n```\n\nOr with explicit workflow IDs:\n\n```bash\nnpx tsx src/index.ts generate --workflows \"minimal-chatbot,cicd-notifier\" --output ./my-server\n```\n\nOr with a config file (`.mcp-generator.yaml`):\n\n```yaml\nprovider: rocketchat\ncapabilities:\n  - onboard new members\n  - CI/CD notifications\noutput: ./my-server\nname: my-rc-mcp\n```\n\n```bash\nnpx tsx src/index.ts generate\n```\n\n## CLI Commands\n\n| Command | Description |\n|---------|-------------|\n| `generate` | Generate a minimal MCP server |\n| `list` | Show all available workflows with token costs |\n| `measure --all` | Token savings comparison table |\n| `measure --capabilities \"...\"` | Measure savings for natural language input |\n\n## Available Workflows\n\n| Workflow | Steps | Tokens | Savings | Features |\n|----------|-------|--------|---------|----------|\n| onboard-team-member | 5 | ~184 | 88.8% | decision logic |\n| customer-support-bot | 5 | ~163 | 90.1% | decision, events, retry |\n| cicd-notifier | 5 | ~162 | 90.2% | decision, retry |\n| team-standup | 5 | ~137 | 91.7% | retry |\n| content-moderation | 6 | ~138 | 91.6% | decision, events |\n| channel-management | 5 | ~145 | 91.2% | decision |\n| message-search | 3 | ~128 | 92.2% | |\n| file-sharing | 3 | ~120 | 92.7% | |\n| analytics-reporter | 4 | ~108 | 93.4% | decision, retry |\n| webhook-integration | 4 | ~139 | 91.6% | |\n| notification-bot | 2 | ~126 | 92.4% | decision |\n| minimal-chatbot | 3 | ~98 | 94.1% | retry |\n\n## What Makes This Different\n\nOther generators produce thin API wrappers:\n\n```typescript\n// Thin wrapper\nserver.tool(\"onboard_user\", {}, async ({ username, channels }) => {\n  await client.post(\"/api/v1/users.create\", { username });\n  for (const ch of channels) {\n    await client.post(\"/api/v1/channels.invite\", { roomId: ch });\n  }\n});\n```\n\nThis generator produces platform-level tools with real logic:\n\n```typescript\n// Generated: decision logic, error handling, rollback\nserver.tool(\"rc_onboard_team_member\", {}, async ({ username, email, role }) => {\n  const existing = await client.get(\"/api/v1/users.info\", { username });\n\n  if (existing?.user != null) {\n    userId = existing.user._id;\n  } else {\n    const created = await client.post(\"/api/v1/users.create\", {\n      username, email, password: crypto.randomUUID().slice(0, 16),\n    });\n    userId = created.user._id;\n  }\n\n  // Role-based channel selection, per-channel error handling,\n  // welcome DM with skip-on-failure strategy\n});\n```\n\n## Architecture\n\n```\nUser input (NL / config / flags)\n    │\n    ├─ [NL Parser] ── fuse.js fuzzy matching → workflow templates\n    │\n    ├─ [ProviderSpec] ── generic platform interface (RC first impl)\n    │\n    ├─ [WorkflowTemplate] ── decision points, error handlers, rollback\n    │\n    ├─ [Code Emitter] ── Handlebars → TypeScript with real if/else/try/catch\n    │\n    ├─ [Token Counter] ── measures and reports savings\n    │\n    └─ Generated Output: MCP Server + RC App (if events needed)\n```\n\n## Generated Output\n\nSingle workflow (no events):\n\n```\nmy-server/\n  server/src/\n    index.ts          # MCP server entry\n    client.ts         # RC HTTP client\n    tools/\n      minimal-chatbot.ts\n  package.json\n  gemini-extension.json\n  .env.example\n```\n\nWorkflows with real-time events (monorepo):\n\n```\nmy-server/\n  server/            # MCP server\n  rc-app/            # Rocket.Chat App event bridge\n    app.json\n    src/index.ts     # Listens for events, forwards via HTTP callback\n  package.json\n  gemini-extension.json\n```\n\n## gemini-cli Integration\n\nInstall generated server as a gemini-cli extension:\n\n```bash\ngemini extensions install ./my-server\n```\n\nOr configure manually in `~/.gemini/settings.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"rocketchat\": {\n      \"command\": \"node\",\n      \"args\": [\"./my-server/server/dist/index.js\"]\n    }\n  }\n}\n```\n\n## Development\n\n```bash\nnpm install\nnpm test              # 88 tests\nnpm run test:workflows # 54 workflow tests\nnpm run benchmark     # token savings report\n```\n\n## Token Savings Benchmark\n\nCombo scenarios across a 10-iteration agent loop:\n\n| Scenario | Tools | Tokens | Full | Savings |\n|----------|-------|--------|------|---------|\n| Messaging only | 1 | ~98 | ~1648 | 94.1% |\n| Support team | 2 | ~301 | ~1648 | 81.7% |\n| DevOps | 3 | ~427 | ~1648 | 74.1% |\n| Team lead | 3 | ~466 | ~1648 | 71.7% |\n| Full admin | 4 | ~575 | ~1648 | 65.1% |\n\nAverage single-workflow savings: **91.7%**\n\n## Tech Stack\n\n- TypeScript (strict mode)\n- Handlebars (deterministic codegen, zero LLM)\n- fuse.js (natural language matching)\n- commander + @inquirer/prompts (CLI)\n- vitest (88 tests)\n- @modelcontextprotocol/sdk (in generated output)\n- @rocket.chat/apps-engine (in generated RC App)\n",
  "bytes": 5325,
  "sha": "f657070df68c5d7492fb4facf9ff56b606066d3c82de413fcda44b63f5aa0176",
  "repo_slug": "mossae/mcp-generator",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_mossae_mcp_generator_c5b0e78f/readme"
}