MCP-OS
by giao-123-sun
MCP-OS is a Model Context Protocol Orchestration System that manages MCPs like an operating system manages processes, loading them on demand and unloading them when idle. It aims to help large language models focus on solving tasks by efficiently managing and retrieving relevant MCPs.
Last updated: N/A
MCP-OS Β· Model Context Protocol Orchestration System
Let your large language model focus on solving tasksβnot wading through a sea of MCPs.
β¨ Project Vision
As the Model Context Protocol (MCP) ecosystem explodes, hundreds of MCP servers create three familiar headaches:
| Pain Point | Description | | ---------- | ----------- | | Prompt Bloat | Lengthy MCP descriptions crowd the context window; the model spends more tokens picking tools than planning / analysis. | | Connection Hygiene | We must constantly track which MCPs are alive and whether they satisfy the current task. | | Resource & Security | Always-on MCP servers consume memory and expose interfaces, increasing attack surface. |
MCP-OS aims to:
βManage MCPs the way an operating system manages processesβload on demand, unload when idle.β
π Current Phase: MCP-Retriever (Completed β )
- Vector Retrieval β Embed task descriptions and retrieve Top-k MCPs from a vector index.
- Slim Prompt Template β Inject only the Top-k MCP descriptions, saving ~70 % prompt tokens on average.
- Pluggable Back-ends β Default
openai/embeddings
; swap in FAISS, Qdrant, Milvus, etc.
π Details in
/packages/retriever
.
π£οΈ Roadmap
| Milestone | Feature | Status | | --------- | ------- | ------ | | v0.1 | MCP-Retriever β vector search | β Released | | v0.2 | MCP-Retriever - light version | β³ In progress | | v0.3 | Health-Check Daemon β auto heartbeat & pruning | β³ In progress | | v0.4 | Runtime Manager β on-demand MCP start/stop | π Planned | | v1.0 | Policy Sandbox β fine-grained auth, rate, cost | π Planned |
βοΈ Quick Start
1. Clone & Install
git clone https://github.com/your-org/mcp-os.git
cd mcp-os
npm install # or npm / yarn
2. Build the Vector Index
# Scan local / remote MCP metadata and create an index
npm run build:index --src ./mcp_list.json --out ./index
3. Start the Retriever Server
npm run start:retriever
# Default listens on 127.0.0.1:5500 (HTTP + SSE)
4. Wire It into Your LLM / Agent
// Example: Claude Desktop
{
"mcpServers": {
"mcp-os": {
"command": "/absolute/path/to/mcp-os/bin/retriever.js"
}
}
}
Or call the REST endpoint:
curl -X POST http://localhost:5500/match \
-H "Content-Type: application/json" \
-d '{"task": "Scrape a web page and extract its title"}'
Sample response:
{
"matches": [
{
"id": "web-scraper",
"score": 0.89,
"functions": ["fetchHtml", "querySelector"]
}
]
}
π Repository Layout
mcp-os/
ββ packages/
β ββ retriever/ # Phase 1: vector retrieval
β ββ health-check/ # Phase 2: heartbeat daemon (WIP)
β ββ runtime-manager/ # Phase 3: load/unload (planned)
ββ scripts/ # CLI helpers
ββ examples/ # Usage demos
ββ docs/ # Architecture & deep dives
π§© MCP List Format
mcp_list.json
describes MCP metadata:
{
"web-scraper": {
"name": "Web Scraper MCP",
"description": "Fetches HTML and parses DOM.",
"functions": ["fetchHtml", "querySelector"]
},
"calc": { ... }
}
β FAQ
<details> <summary>Retrieval quality is poorβhow do I tune it?</summary>- Increase
topK
for higher recall. - Switch to a stronger embedding model.
- Refine task-text normalization rules.
Implement the VectorStore
interface: src/store/yourStore.ts
.
π€ Contributing
- Fork the repo
- Create a branch
feature/awesome-stuff
- Open a PR and link related issues
- Wait for CI + review π
π License
π Acknowledgements
- The Model Context Protocol community for the open specification
- MCP Inspector for debugging
- Everyone who files issues or PRsβthank you! β€οΈ