mcp-as-a-service

LLMBaseAI/mcp-as-a-service

3.2

If you are the rightful owner of mcp-as-a-service and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The MCP Registry Server is a dynamic and intelligent platform designed to host and proxy Model Context Protocol (MCP) servers, offering seamless package detection and on-demand installation.

MCP-as-a-Service

Bun Protocol

Run MCP servers remotely over HTTP/SSE with on-demand package execution.

mcp-as-a-service fetches MCP packages from npm/PyPI, runs them in isolated Podman containers, and exposes them through a web-friendly gateway so clients do not need local stdio runtimes.

Built with Bun + Hono + TypeScript.

Why This Project

  • Centralize MCP runtime execution on infrastructure you control
  • Share remote MCP connectivity across many clients
  • Start package runtimes only when needed
  • Isolate runtimes with Podman security boundaries
  • Keep protocol support first-class (2024-11-05)

Best Fit

  • Internal MCP gateway for teams
  • Hosted MCP runtime for clients that cannot run local processes
  • Controlled package execution environment with observability

Quickstart

Prerequisites:

  • Bun 1.1+
  • Podman (rootless)

Setup:

bun install
bun run build:runtime-images
bun run dev

Production start:

bun run start

Run tests:

bun test

Default port: 8787 (or PORT env var).

First Success in 60 Seconds

  1. Start an SSE stream:
curl -N "http://127.0.0.1:8787/package/firecrawl-mcp/sse?firecrawlApiKey=YOUR_KEY"
  1. Send a JSON-RPC message:
curl -X POST "http://127.0.0.1:8787/package/firecrawl-mcp/messages?firecrawlApiKey=YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'

API Overview

Core:

  • GET / service metadata and usage hints
  • GET /health health + protocol status
  • GET /servers active runtime stats

MCP protocol:

  • POST /mcp JSON-RPC 2.0 endpoint
  • GET /mcp/capabilities server capabilities/status

HTTP/SSE package bridge:

  • GET /package/:packageName/sse stream server events/messages
  • POST /package/:packageName/messages send JSON-RPC payloads

Canonical write endpoint is POST /package/:packageName/messages. Removed aliases:

  • POST /package/:packageName/respond
  • POST /package/:packageName/message

Client Usage Example

Claude Desktop:

claude mcp add firecrawl \
  'https://mcp.llmbase.ai/package/firecrawl-mcp/sse?firecrawlApiKey=YOUR_KEY' \
  -t http

Direct MCP:

curl -X POST https://mcp.llmbase.ai/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'

Security and Runtime Model

  • Podman-only execution model
  • Hardened container defaults (caps dropped, resource limits, isolated network mode)
  • Input and argument sanitization
  • Parameter-to-env mapping for package configuration
  • Automatic cleanup of inactive runtimes

Ubuntu Podman prerequisites:

sudo apt-get update
sudo apt-get install -y podman uidmap slirp4netns fuse-overlayfs apparmor apparmor-utils
podman --version
podman info | grep rootless

Current Limits

  • In-memory process registry (state resets on restart)
  • maxConcurrentProcesses default: 10
  • Container startup latency depends on package install/bootstrap time

Architecture

Client (Claude/Desktop/App)
  -> HTTP/SSE
mcp-as-a-service
  -> JSON-RPC over stdio
Containerized MCP package runtime (npm/pypi)
  -> external APIs/tools/resources

Project Structure

src/
  app/         app wiring and routes
  transport/   HTTP/SSE and MCP protocol controllers
  runtime/     process orchestration, execution plans, stdio framing
  packages/    package parsing and registry detection
  security/    input and environment policies
  shared/      config, logging, errors, and types

Documentation

  • docs/API_REFERENCE.md endpoint reference and examples
  • docs/DEPLOYMENT.md production deployment runbook
  • docs/OPERATIONS.md day-2 operations commands
  • docs/MIGRATION.md breaking-change migration notes
  • docs/TROUBLESHOOTING.md common failures and fixes
  • docs/MCP_COMPLIANCE.md MCP protocol implementation details
  • docs/CLOUDFLARE_SETUP.md Cloudflare setup guidance
  • CONTRIBUTING.md contribution workflow
  • SECURITY.md vulnerability reporting policy
  • CODE_OF_CONDUCT.md contributor behavior standards