How bitteprotocol/mcp works
Project type and purpose
• This is a backend‑focused monorepo hosting one or more MCP (Model Control Protocol) servers.
• The primary service (“bitte‑ai”) delivers real‑time SSE (Server‑Sent Events) streams at the /sse endpoint, allowing clients (e.g., the Cursor app) to connect and receive model control data.
File structure
• Top‑level directories and files:
• apps/bitte‑ai: contains the MCP server implementation (config.ts, index.ts, plugins, tools, utils).
• packages/: placeholder for additional MCP servers or shared libraries.
• scripts/: orchestration scripts (docker‑down, start‑all, start‑dev).
• docker-compose.yml: local container orchestration.
• .github/workflows/cicd.yml: CI/CD pipeline on GitHub Actions.
• turbo.json & tsconfig.json: Turborepo monorepo settings.
• biome.json: code quality configuration.
• Key patterns:
• Monorepo management via Turborepo.
• Containerization with Docker + Docker Compose.
• SSE as the communication mechanism with external clients.
README for additional insights
• Confirms Bun as the runtime.
• Defines commands for build, dev, lint, starting services.
• Points to externally hosted SSE URI (https://mcp.bitte.ai/sse).
• Describes how to add additional MCP servers under packages/.
Main components and their interactions
a. Developer Workstation
• Tools: Bun runtime, Turborepo, Biome, Docker CLI.
• Executes bun run dev / scripts/start-dev.ts to run local services.
b. Monorepo Build Layer
• Turborepo gathers code from apps/ and packages/, compiles via Bun/tsup, outputs artifacts.
• Biome ensures code quality.
c. CI/CD Pipeline (GitHub Actions)
• Triggers on pushes/PRs.
• Runs build, tests, lint, and Docker image publishing.
d. Container Layer (Docker Compose)
• Hosts one or more MCP server containers (bitte‑ai).
• Configurations injected via .env or .env.example.
e. MCP Server (bitte‑ai)
• HTTP server exposing /sse SSE endpoint.
• Internally uses plugins (lib/bitte-plugins.ts), search utilities, and tools (base‑agentkit, goat‑sdk).
• Connects to downstream AI/Model services or registries via utils/bitte.ts and utils/search.ts.
f. External Clients
• Cursor app or other consumers subscribes to the SSE stream at https://mcp.bitte.ai/sse.
Architectural patterns and design principles
• Monorepo with isolated workspaces for each service.
• Modular code: clear separation into config, core logic (index.ts), plugins, utilities, SDK wrappers.
• Containerization for environment parity.
• CI/CD as code for automated quality gates and deployments.
• SSE for uni‑directional, real‑time event streaming.