LLMBaseAI/mcp-as-a-service
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
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
- Start an SSE stream:
curl -N "http://127.0.0.1:8787/package/firecrawl-mcp/sse?firecrawlApiKey=YOUR_KEY"
- 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 hintsGET /healthhealth + protocol statusGET /serversactive runtime stats
MCP protocol:
POST /mcpJSON-RPC 2.0 endpointGET /mcp/capabilitiesserver capabilities/status
HTTP/SSE package bridge:
GET /package/:packageName/ssestream server events/messagesPOST /package/:packageName/messagessend JSON-RPC payloads
Canonical write endpoint is POST /package/:packageName/messages.
Removed aliases:
POST /package/:packageName/respondPOST /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)
maxConcurrentProcessesdefault: 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.mdendpoint reference and examplesdocs/DEPLOYMENT.mdproduction deployment runbookdocs/OPERATIONS.mdday-2 operations commandsdocs/MIGRATION.mdbreaking-change migration notesdocs/TROUBLESHOOTING.mdcommon failures and fixesdocs/MCP_COMPLIANCE.mdMCP protocol implementation detailsdocs/CLOUDFLARE_SETUP.mdCloudflare setup guidanceCONTRIBUTING.mdcontribution workflowSECURITY.mdvulnerability reporting policyCODE_OF_CONDUCT.mdcontributor behavior standards