How getdatanaut/openmcp works
Project type and purpose
• This is a monorepo (managed by Yarn v4 and Nx) containing:
• A web frontend (“apps/web” – a Remix/React SSR app deployed with Wrangler)
• A CLI tool (“packages/cli”)
• A server implementation (“packages/server”)
• Supporting libraries (“packages/manager”, “packages/openapi”, “packages/schemas”, “packages/utils”)
• Purpose: provide an API‐first platform (“MCP”) with an interactive CLI and web UI, driven by OpenAPI specs and shared schemas, plus server runtime.
File structure
• Top‐level config:
• .github/workflows + custom actions for CI/CD
• nx.json + yarnrc for workspace orchestration
• apps/web: React/Remix SSR with route files, client.tsx, ssr.tsx, deployed as a Cloudflare Worker (wrangler.jsonc)
• packages/cli: Node‐based command‐line tool, using internal libraries (datanaut, mcp‐clients, openapi, platform, remix utils, etc.)
• packages/manager: core in‐process manager for client–server coordination
• packages/openapi: tools for loading, validating, and converting OpenAPI documents
• packages/schemas: shared TypeScript schemas for MCP resources
• packages/server: HTTP server that exposes MCP endpoints, using shared schemas and manager
• packages/utils: generic utility functions (docs parsing, variable replacement, etc.)
Architectural patterns
• Monorepo with modular packages promotes code sharing and consistent versions
• API‐first design: OpenAPI library drives client/server contract
• Separation of concerns:
• “manager” library encapsulates business logic and in‐memory state
• “server” exposes routes and transforms HTTP⇄manager calls
• “cli” and “web” are thin clients consuming APIs
Main components & interactions
a. Components:
• GitHub Actions / CI pipeline (build/test)
• Monorepo orchestrator (Yarn/Nx)
• Shared libraries: schemas, utils, openapi, manager
• Backend server (“packages/server”)
• CLI tool (“packages/cli”)
• Web app (“apps/web”)
• External services (e.g. Cloudflare Workers, external OpenAPI endpoints)
b. Relationships & data flow:
• “cli” and “web” → HTTP/gRPC calls → “server”
• “server” ↔ in‐process “manager” (state + resource management)
• “manager” uses shared “schemas” and “utils” to validate and manipulate data
• “cli” and “server” use “openapi” library to load/validate spec files
• Deployment: “apps/web” → Cloudflare Workers; “server” → Node host or container
c. Architectural patterns:
• Monorepo modularization
• API‐first with OpenAPI-driven code
• SSR frontend separated from API backend
• Command pattern in CLI (commands/install, upload, run, etc.)
d. Key technologies:
• Node.js, TypeScript, Nx, Yarn Workspaces
• React/Remix for SSR web
• Cloudflare Workers (wrangler)
• Vitest for testing, ESlint, Turborepo logs
• OpenAPI library, in‐memory manager
Essential elements
• That everything lives in one repo, built and tested together (CI/CD)
• API boundary between clients (CLI/Web) and the server
• Don’t break libraries into too many pieces—group by responsibility (schemas, utils, openapi, manager)
• Deployment targets: CF Workers for web, Node host for server, global installation for CLI