Rocket.Chat Minimal MCP Server Generator

Rocket.Chat Minimal MCP Server Generator

Generates customized, production-grade MCP servers for Rocket.Chat by selecting only the specific API endpoints needed for a project to minimize context bloat and token usage. It uses natural language processing to parse official OpenAPI specs and automatically create optimized TypeScript servers with built-in authentication and tests.

Category
Visit Server

README

Rocket.Chat Minimal MCP Server Generator

A gemini-cli extension that generates minimal MCP servers covering only the Rocket.Chat API endpoints your project needs — solving context bloat.

The Problem

Today, one major problem when adopting MCP is "context bloat" — almost all MCP servers are written to support a large set of service APIs, and anyone adopting them will have most of their token budget consumed by static MCP requirements associated with API calls they will never need. This situation is exacerbated in agentic code generator workflows where every agent is burning tokens in loops unnecessarily while supporting APIs/tools that the project will never use.

The Solution

This generator solves context bloat by letting Rocket.Chat developers generate a production-grade minimal MCP server covering only the subset of APIs required by their project. It automatically parses Rocket.Chat's official OpenAPI specs at runtime, lets you describe what you need in plain English, identifies the relevant API domains, presents endpoints grouped by functionality, recommends the most relevant ones for your use case, and lets you adjust the selection to match your project's exact needs. The output is a multi-file MCP server with auto-generated tests, a shared HTTP client, and authentication handling built in — significantly reducing the cost of all Rocket.Chat code generation projects involving MCP.

Key Features

  • Automatic OpenAPI parsing — Fetches Rocket.Chat's official OpenAPI YAML specs from GitHub at runtime and parses them using @apidevtools/swagger-parser, dereferencing all $refs into a fully resolved spec. No manual endpoint definitions needed.
  • Zero maintenance — When RC adds or changes endpoints, they're available immediately. No manual updates, no version lag.
  • Full API coverage — All 12 Rocket.Chat API domains available out of the box, always in sync with the official spec.
  • Tag-based grouping — Endpoints are organized by semantic tags (e.g., "Chat", "Channels", "DM") so Gemini can quickly identify the right operationIds for workflow composition.
  • Three-tier caching — Parsed specs are cached in memory for instant reuse, persisted to disk (24h TTL) to survive restarts, and fetched from GitHub only on cache miss. Parse once, reuse everywhere.
  • Lazy schema extraction — When browsing endpoints, only lightweight summaries (name, method, path) are extracted. The expensive JSON Schema mapping only runs for the endpoints you actually select for generation.
  • Parallel domain fetching — When multiple API domains are queried (e.g., omnichannel + messaging), all specs are fetched and parsed concurrently rather than one at a time.
  • Domain-indexed lookup — During browsing, the tool builds an index of which endpoints belong to which domain. When generating, it uses this index to search only the relevant spec files instead of scanning all 12.
  • Multi-file output with tests — Template-based TypeScript generation using @modelcontextprotocol/sdk. Each generated server is a complete project: one file per tool, a shared HTTP client for all API calls, per-tool test files, server-level tests, a README with setup instructions, and config files.
  • Minimality report — After generation, shows exactly how much you saved: endpoint count reduction, schema size reduction, and estimated token savings compared to a full-coverage server.

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/sezallagwal/mcpGenerator
    cd mcpGenerator
    
  2. Install dependencies:

    npm install
    
  3. Register as a gemini-cli extension:

    mkdir -p ~/.gemini/extensions
    ln -s "$(pwd)" ~/.gemini/extensions/mcpGenerator
    

    This symlinks the project into gemini-cli's extensions directory so it's loaded automatically.

Usage

Launch gemini in any project directory. The extension provides two MCP tools that Gemini uses automatically based on your natural language requests.

Quick Start

Just describe what you want in plain English:

gemini> I need an MCP server that can send messages and manage channels

Gemini will:

  1. Identify the relevant API domains from your description
  2. Fetch all endpoints and pick the operationIds needed for your use case
  3. If realtime events are needed, discover available Apps-Engine capabilities
  4. Ask where to save the project
  5. Compose the workflow, validate, and generate the complete project in one call

See Workflow Details below for the full step-by-step.

Slash Command

You can also use the explicit slash command:

gemini> /generator:generate send alerts based on workspace statistics

Example Prompts

  • "Generate an MCP server for sending messages and managing channels"
  • "I need a support bot that handles live chat and messaging"
  • "Build an MCP server to monitor workspace health and statistics"
  • "Create tools for user management and role assignment"

Workflow Details

The workflow is fully automated — Gemini handles endpoint selection, workflow composition, and code generation autonomously based on your description.

  1. Describe your intent — Just say what you want in plain English (e.g., "build a support bot for live chat"). You don't need to know API domain names — Gemini maps your keywords to the right domains automatically.
  2. Capability guide — Gemini calls get_capability_guide which returns all endpoints and app events. Gemini picks the operationIds and eventInterfaces it needs.
  3. Schema lookup — Gemini calls get_endpoint_schemas with the chosen operationIds to get exact request/response schemas and event shapes.
  4. Generated! — Gemini passes the workflow steps and configuration directly to generate, which validates, composes, and writes the complete project to disk in one call.

Generated Project Structure

The generator creates a monorepo with an MCP server (always) and optionally an RC App (if realtime events are needed):

my-project/
├── mcp-server/
│   ├── src/
│   │   ├── server.ts          # MCP server entry point
│   │   ├── rc-client.ts       # Shared Rocket.Chat HTTP client
│   │   ├── tools/
│   │   │   └── *.ts           # One file per workflow tool
│   │   └── tests/
│   │       └── setup.ts       # Test setup
│   ├── package.json
│   ├── tsconfig.json
│   ├── .env.example
│   └── README.md
└── rc-app/                    # Only if eventInterfaces provided
    ├── *App.ts                # Main app class
    ├── handlers/              # Event handler files
    ├── commands/              # Slash command files
    ├── bridge/                # HTTP bridge to MCP server
    └── package.json

Using the Generated Server

cd my-rc-server
npm install
cp .env.example .env
# Edit .env with your Rocket.Chat credentials

The generated server uses stdio transport. To use it, add it to your MCP client's configuration:

{
  "mcpServers": {
    "my-rc-server": {
      "command": "npm",
      "args": ["start"],
      "cwd": "/path/to/my-rc-server"
    }
  }
}

You can also run npm start directly to test the server on stdio.

Available API Domains

The generator covers all 12 Rocket.Chat API domains (~500-800+ endpoints total):

Domain Description
authentication Login, OAuth, 2FA, tokens
messaging Send messages, threads, reactions, pins
rooms Channels, groups, DMs, room settings
user-management Users, roles, avatars, presence
omnichannel Live chat, agents, visitors, queues
integrations Webhooks, incoming/outgoing integrations
settings Workspace settings, permissions, OAuth apps
statistics Server stats, online users, metrics
notifications Push notifications, preferences
content-management Emoji, custom sounds, assets
marketplace-apps Apps, marketplace, permissions
miscellaneous Server info, DNS, licenses

API specs are fetched from the official Rocket.Chat OpenAPI repo at runtime, so the generator always reflects the latest available endpoints.

Development

Project Structure

mcpGenerator/
├── gemini-extension.json    # Extension manifest
├── GEMINI.md                # Model instructions for Gemini
├── commands/
│   └── generator/
│       └── generate.toml    # /generator:generate slash command
├── src/
│   ├── server.ts            # MCP server (3 tools: get_capability_guide, get_endpoint_schemas, generate)
│   ├── utils.ts             # Shared utilities
│   ├── mcp-server/
│   │   ├── mcpServerCodegen.ts    # Workflow → TypeScript code generator
│   │   ├── mcpServerTemplates.ts  # Shared project scaffolding templates
│   │   ├── workflowComposer.ts    # Workflow validation & composition
│   │   ├── types.ts               # Workflow type definitions
│   │   └── parser/
│   │       ├── index.ts           # OpenAPI parser (fetch, list, extract)
│   │       ├── schema-mapper.ts   # OpenAPI → JSON Schema conversion
│   │       └── types.ts           # Parser type definitions
│   ├── rc-app/
│   │   ├── rcAppGenerator.ts      # RC App project orchestrator
│   │   ├── rcAppTemplates.ts      # RC App code templates
│   │   ├── parser.ts              # Apps-Engine capability parser (ts-morph)
│   │   └── types.ts               # RC App type definitions
│   └── tests/
│       ├── parser.test.ts
│       ├── generate.test.ts
│       ├── workflow.test.ts
│       ├── rc-app.test.ts
│       └── rc-app-parser.test.ts
├── package.json
└── tsconfig.json

Running Tests

npm test

Building

npm run build

Running in Dev Mode

npm run dev

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Rocket.Chat Minimal MCP Server Generator