diff --git a/integrations/README.md b/integrations/README.md index 3f5a418b..7234e3d6 100644 --- a/integrations/README.md +++ b/integrations/README.md @@ -22,6 +22,12 @@ Integration with NVIDIA's AI model ecosystem: - Performance optimization examples - Multiple example implementations (intro, marketing strategy) +### 4. Decision Anchor MCP +Integration with Decision Anchor via MCP for external accountability proof: +- Connects to DA's remote MCP server using `MCPServerAdapter` +- Records decision boundaries for payments, delegation, and disputes +- No DA API key needed — agents register via MCP tools + ## Integration Patterns These examples demonstrate: diff --git a/integrations/decision_anchor_mcp/README.md b/integrations/decision_anchor_mcp/README.md new file mode 100644 index 00000000..c62b8a7c --- /dev/null +++ b/integrations/decision_anchor_mcp/README.md @@ -0,0 +1,32 @@ +# Decision Anchor MCP Integration + +Connect CrewAI agents to [Decision Anchor](https://github.com/zse4321/decision-anchor-sdk)'s remote MCP server using `MCPServerAdapter`. + +Decision Anchor provides external accountability proof for agent payments, delegation, and disputes via MCP. It does not monitor, judge, or intervene. + +## What this example does + +1. Connects to DA's MCP server (`https://mcp.decision-anchor.com/mcp`) via `MCPServerAdapter` +2. Registers a new agent (one-time, no DA API key required) +3. Creates a Decision Declaration (DD) with accountability scope for a delegated task +4. Reports the DD ID and anchored timestamp + +## Setup + +```bash +pip install crewai crewai-tools[mcp] +``` + +## Usage + +```bash +export OPENAI_API_KEY=your_key +python main.py +``` + +## Notes + +- No DA API key needed — agents register via MCP tools and receive Trial 500 DAC / 30 days +- Running this creates a real agent registration and decision record on DA +- The MCP server uses streamable HTTP transport +- Full agent guide: [AGENTS.md](https://github.com/zse4321/decision-anchor-sdk/blob/main/AGENTS.md) diff --git a/integrations/decision_anchor_mcp/main.py b/integrations/decision_anchor_mcp/main.py new file mode 100644 index 00000000..4c2d9158 --- /dev/null +++ b/integrations/decision_anchor_mcp/main.py @@ -0,0 +1,78 @@ +"""CrewAI agent with Decision Anchor MCP integration. + +Connects CrewAI agents to Decision Anchor's remote MCP server +using MCPServerAdapter for external accountability proof. + +Use case: a crew handling delegated tasks records each handoff +boundary via DA, so that responsibility disputes between agents +have externally-anchored proof. + +Requirements: + pip install crewai crewai-tools[mcp] + +Usage: + export OPENAI_API_KEY=your_key + python main.py +""" + +from crewai import Agent, Crew, Process, Task + +from crewai_tools import MCPServerAdapter + +# Decision Anchor's remote MCP server — no API key needed +da_server_params = { + "url": "https://mcp.decision-anchor.com/mcp", + "transport": "streamable_http", +} + + +def main(): + with MCPServerAdapter(da_server_params) as da_tools: + accountability_agent = Agent( + role="Accountability Recorder", + goal=( + "Record decision boundaries for actions " + "that involve external effects" + ), + backstory=( + "You ensure that every payment, delegation, or " + "external action has its accountability scope " + "recorded externally via Decision Anchor. " + "This protects the team when disputes arise later." + ), + tools=da_tools, + verbose=True, + ) + + record_task = Task( + description=( + "1. Register as a new agent on Decision Anchor " + "with name 'crewai-demo-agent'. " + "2. Create a Decision Declaration (DD) with " + "action_type 'execute' and summary " + "'Delegated data processing task to specialist agent'. " + "Use retention short, integrity basic, " + "disclosure internal, responsibility minimal. " + "3. Report the DD ID and anchored timestamp." + ), + expected_output=( + "DD ID and timestamp confirming the decision " + "was externally anchored." + ), + agent=accountability_agent, + ) + + crew = Crew( + agents=[accountability_agent], + tasks=[record_task], + process=Process.sequential, + verbose=True, + ) + + result = crew.kickoff() + print("\n=== Result ===") + print(result) + + +if __name__ == "__main__": + main() diff --git a/integrations/decision_anchor_mcp/requirements.txt b/integrations/decision_anchor_mcp/requirements.txt new file mode 100644 index 00000000..6c29ef0b --- /dev/null +++ b/integrations/decision_anchor_mcp/requirements.txt @@ -0,0 +1,2 @@ +crewai +crewai-tools[mcp]