Skip to main content

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

  1. Incoming MCP request arrives
  2. Middleware extracts the server URL from request headers/metadata
  3. Queries Observatory's trust API (cached for 5 min by default)
  4. If score >= threshold: request proceeds normally
  5. If score < threshold: returns JSON-RPC error with trust details
  6. 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.

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)

Source distribution for fastmcp-dominion 0.1.0
File Size Uploaded
fastmcp_dominion-0.1.0.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fastmcp-dominion 0.1.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page