Skip to main content

CrewAI event listener for the Dominion Observatory — report MCP tool behaviour from CrewAI crews and flows to the cross-ecosystem runtime trust layer.

Project description

dominion-observatory-crewai

CrewAI integration for the Dominion Observatory — the runtime behavioural trust layer for MCP servers.

Drop-in event listener for any CrewAI Crew, Flow, or Agent that calls MCP tools. Your MCP calls get:

  • Runtime trust telemetry published to a cross-ecosystem registry of 4,500+ MCP servers.
  • Honest, agent-reported data — not GitHub stars, not registry manifests.
  • Zero payload leakage — six fields per report, nothing more.

CrewAI 1.x ships a first-class event bus and first-class MCP primitives. This adapter just connects them.


Install

pip install dominion-observatory-crewai

Python 3.10 – 3.13. Requires crewai >= 1.0.0 (installed by your project) and dominion-observatory-sdk >= 0.2.0 (pulled in automatically).


One-line wiring

from dominion_observatory_crewai import ObservatoryCrewAIListener

# Instantiate once at process start — the listener auto-registers on
# CrewAI's singleton event bus.
observatory = ObservatoryCrewAIListener(agent_id="acme-scheduler@1.2.0")

crew.kickoff(inputs={...})

Every MCPToolExecutionCompletedEvent, MCPToolExecutionFailedEvent, and MCPConnectionFailedEvent CrewAI emits is translated into a single dominion_observatory.report(...) call.


What gets sent

Exactly these six fields per event, and nothing else:

Field Example
agent_id acme-scheduler@1.2.0
server_url https://my-mcp-server.example.com/mcp
success true / false
latency_ms 142
tool_name get_holidays
http_status 200 / 504 / 401 / ...

Not sent: tool arguments, tool outputs, user IDs, prompts, IP addresses, auth tokens. Satisfies Singapore PDPA and is compatible with EU AI Act Article 12 logging.

For failures, CrewAI's MCP error_type taxonomy (timeout, authentication, validation, network, server_error) is mapped to an HTTP-ish status code so the Observatory can bucket failure modes without receiving any error string.


Choosing a stable agent_id

Required by dominion-observatory-sdk >= 0.2.0. Must be non-empty and not "anonymous" or "observatory_probe".

Recommended patterns:

  • "my-app@1.0.0" — package-name + version (stable across restarts).
  • str(uuid.uuid4()) persisted to disk on first run (stable per install).
  • f"{environ['HOSTNAME']}/my-service" — per-deployment.

Do not use per-request IDs — you will fragment your own trust history.


Design notes

  • Defensive: every Observatory call is wrapped in a broad except so a network hiccup, import failure, or SDK validation error never disturbs the running Crew.
  • Zero side effects on import: the dominion_observatory SDK is imported lazily inside the report helper.
  • Selective scope: v0.1.0 hooks only MCP events. Non-MCP ToolUsageFinishedEvent coverage is planned for v0.2.0 with an opt-in metadata key.
  • Singleton-safe: CrewAI's event bus is a global singleton; instantiating the listener more than once registers duplicate handlers. Call it once at process start.

Development

# From the adapter directory:
pip install -e ".[crewai,test]"
pytest

Part of the Dominion Agent Economy Engine

This adapter is maintained by the DAEE-HITMAN distribution sub-agent. Source lives at vdineshk/daee-hitman under the MIT licence. File issues there.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dominion_observatory_crewai-0.1.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dominion_observatory_crewai-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file dominion_observatory_crewai-0.1.0.tar.gz.

File metadata

File hashes

Hashes for dominion_observatory_crewai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 05a08953b335a5857591adf7c7baef6d271b4f93d585efcb141fab0a4ef60bc4
MD5 9df3211b07876b422e7bbed117a8567b
BLAKE2b-256 462e8c87154211d32bc4e993f2a6d4af3e40f8067e015110c427c748fcb40c81

See more details on using hashes here.

File details

Details for the file dominion_observatory_crewai-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dominion_observatory_crewai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f482db2bb5f8c84d936f36d5f8a6259db21e2905f82eb93dfe5da8bc5d95443
MD5 01f42a0f4b17b0c1f9e6f39c61099a42
BLAKE2b-256 c6dc2f4233a6798314076f0e709ac30e555d81138b560ca087eb0d117c7da7e5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page