Install
$ agentstack add mcp-robertocirillo-mcp-bridge ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ● Network access Used
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ● Environment & secrets Used
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
mcp-bridge
[](https://github.com/robertocirillo/mcp-bridge/actions/workflows/ci.yml) [](https://github.com/robertocirillo/mcp-bridge/releases) [](https://github.com/robertocirillo/mcp-bridge) [](LICENSE) [](https://github.com/mcp-use/mcp-use)
mcp-bridge is a REST bridge to the MCP ecosystem, powered by mcp-use, with session-scoped guardrail enforcement around LLM interactions.
Built on the mcp-use runtime, it inherits broad MCP server compatibility from the underlying runtime rather than targeting only a small fixed set of MCP servers. It exposes MCP-backed sessions and queries over HTTP so applications can integrate with the MCP ecosystem through a service boundary instead of embedding MCP orchestration directly.
What this is
- A FastAPI service that exposes MCP sessions and query flows over REST
- A service built on
mcp-usefor MCP connectivity, broad MCP server compatibility, and LLM-backed execution - Support for both synchronous queries and asynchronous query operations with polling
- Multipart image query support when the configured provider and model support multimodal input
- MCP client-side elicitation support for asynchronous operations when servers request additional input during a session
- A session-aware guardrail boundary around LLM interactions
Demo
Create an MCP-backed session, run a sync REST query, and clean up the session:
What this is not
- Not a full MCP control plane
- Not a persistent workflow engine
- Not a built-in auth or rate-limiting layer
- Not primarily an A2A platform
/a2a remains a secondary, experimental surface compared with the MCP REST bridge, and is disabled by default until explicitly configured.
Quickstart
Requirements:
- Python 3.12+
uv- Node.js + npm (required for the quickstart example below, which launches the filesystem MCP server via
npx) - At least one usable LLM provider configured (cloud API key or reachable local Ollama)
- An MCP server to launch or connect to
uv sync
cp .env.example .env
# set OPENAI_API_KEY=...
uv run python main.py
Docker Compose orientation
docker-compose.ymlis the simplest starting point. It runsmcp-bridgeonly and is the best default choice if you already have an LLM endpoint available, for example Ollama running outside the stack.docker-compose-full-stack.ymlis the more advanced local stack, not the simplest default. It runsmcp-bridgetogether with additional local services including Ollama, Open WebUI, and the optional bias detector service, and it includes GPU/NVIDIA-oriented configuration for the Ollama/Open WebUI side.docker-compose-dod.ymlanddocker-compose-dind.ymlare specialized setups for Docker MCP Toolkit / gateway scenarios. They add agatewayservice and are intended for cases where MCP server access is mediated through Docker-based gateway patterns rather than the simpler default bridge-only setup.
Once the service is running:
- Health check:
http://localhost:8000/health - OpenAPI / Swagger:
http://localhost:8000/docs
Create a session:
curl -s -X POST "http://localhost:8000/sessions" \
-H "Content-Type: application/json" \
-d '{
"llm_provider": {
"provider": "openai",
"model": "gpt-4o-mini"
},
"mcp_servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
}
}
}'
Run a query in that session:
curl -s -X POST "http://localhost:8000/sessions//query" \
-H "Content-Type: application/json" \
-d '{
"query": "Use the filesystem MCP tools to list the files in /tmp.",
"max_steps": 10
}'
For a longer-running query, use the async flow:
curl -s -X POST "http://localhost:8000/sessions//query-operations" \
-H "Content-Type: application/json" \
-d '{
"query": "Inspect /tmp and summarize what is there."
}'
Poll it:
curl -s "http://localhost:8000/sessions//query-operations/"
Guardrails are configured per session in POST /sessions, so different sessions can enforce different safety policies.
Guardrails example
For example, the session below enables a simple PII policy at session creation time:
curl -s -X POST "http://localhost:8000/sessions" \
-H "Content-Type: application/json" \
-d '{
"llm_provider": {
"provider": "openai",
"model": "gpt-4o-mini"
},
"guardrails": {
"enabled": true,
"pii": {
"input_mode": "block",
"output_mode": "redact"
}
},
"mcp_servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]
}
}
}'
With a session like this, prompts containing PII can be blocked before they reach the model, and model output can be redacted before it is returned through the bridge.
The same session-scoped guardrail model can also be extended with external services, for example for bias detection, without changing the REST interaction pattern. When that integration is enabled, the external bias-detection service base URL is configured through BIAS_DETECTOR_SERVICE_BASE_URL.
Current limitations
- Sessions, async operations, and pending interaction state are stored in memory
- Restarting the service loses active runtime state
- Horizontal scaling and multi-instance coordination are not first-class yet
- Authentication, authorization, and rate limiting are expected to sit upstream
- Multimodal support depends on the configured provider and model capabilities
- A2A support is secondary, experimental, and opt-in compared with the MCP REST bridge
Where next
- [examples/demo/filesystemrestdemo.sh](examples/demo/filesystemrestdemo.sh) for a minimal REST demo script suitable for a quick terminal/video walkthrough
- [examples/README.md](examples/README.md) for minimal client examples
http://localhost:8000/docsfor the full API surface- [docs/ROADMAP.md](docs/ROADMAP.md) for current gaps and planned work
- [LICENSE](LICENSE)
- [SECURITY.md](SECURITY.md)
Source & license
This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: robertocirillo
- Source: robertocirillo/mcp-bridge
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.