fastmcp-dominion
Trust-gated MCP middleware for FastMCP via Dominion Observatory.
Automatically verifies MCP server trust scores before allowing tool calls. Blocks untrusted servers, caches lookups, and provides configurable failure modes.
Installation
pip install fastmcp-dominion
Quick Start
from fastmcp import FastMCP
from fastmcp_dominion import TrustMiddleware
app = FastMCP("my-server")
app.add_middleware(TrustMiddleware(threshold=70))
That's it. All incoming tool calls are now verified against Observatory's behavioral trust scores from 14,800+ MCP servers.
Configuration
from fastmcp_dominion import TrustMiddleware, TrustConfig
config = TrustConfig(
threshold=70.0, # Minimum trust score (0-100)
cache_ttl=300, # Cache scores for 5 minutes
fail_mode="open", # "open" = allow on API error, "closed" = block
log_decisions=True, # Log trust check decisions
bypass_tools=["ping"], # Tools that skip verification
)
app = FastMCP("my-server")
app.add_middleware(TrustMiddleware(config=config))
Synchronous Usage
For scripts or non-async code:
from fastmcp_dominion.middleware import check_trust_sync
result = check_trust_sync("https://some-mcp-server.com/mcp")
print(f"Trust score: {result['trust_score']}")
print(f"Passed: {result['_passed']}")
How It Works
- Incoming MCP request arrives
- Middleware extracts the server URL from request headers/metadata
- Queries Observatory's trust API (cached for 5 min by default)
- If score >= threshold: request proceeds normally
- If score < threshold: returns JSON-RPC error with trust details
- If Observatory unreachable: behavior depends on
fail_mode
API
Observatory tracks 14,800+ MCP servers with behavioral trust scores based on real interaction data. Free tier: 50 queries/day.
- Trust API:
GET https://dominionobservatory.com/api/trust?url=<server_url> - Docs: https://dominionobservatory.com
- GitHub: https://github.com/sgdata-io/dominion-observatory
License
MIT
Metadata
Release files for fastmcp-dominion 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fastmcp_dominion-0.1.0.tar.gz | 5.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| fastmcp_dominion-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.6 kB
Release files / fastmcp_dominion-0.1.0.tar.gz
| Download URL | fastmcp_dominion-0.1.0.tar.gz |
|---|---|
| Size | 5.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55b99ac4a826ff4ea4ae65c1e12042900b360cfd104e2fd76ce75c52d1035da8
|
|
BLAKE2b-256 checksum How to use checksums |
2bbaf50fa26b1b5d2cf07433b04c8d519fc03b63267b7b54961804457d980bdc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / fastmcp_dominion-0.1.0-py3-none-any.whl
| Download URL | fastmcp_dominion-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7485460a7ed23e8f484564b30657944777c1fed5d0cea5f659d648cca26e21d7
|
|
BLAKE2b-256 checksum How to use checksums |
e7514edcaf96c5f912bde0c3cbf768cd0be2aa6157f8b52e5c55fb724ee2c215
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|