agenthandler 0.92.0__tar.gz → 0.93.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. {agenthandler-0.92.0 → agenthandler-0.93.0}/.gitignore +0 -5
  2. {agenthandler-0.92.0 → agenthandler-0.93.0}/CHANGELOG.md +6 -1
  3. {agenthandler-0.92.0 → agenthandler-0.93.0}/PKG-INFO +39 -38
  4. {agenthandler-0.92.0 → agenthandler-0.93.0}/README.md +36 -37
  5. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/__init__.py +33 -1
  6. agenthandler-0.93.0/agenthandler/a2a.py +624 -0
  7. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/connectors.py +3 -3
  8. agenthandler-0.93.0/agenthandler/mcp_server.py +318 -0
  9. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/observe.py +8 -8
  10. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/redact.py +1 -1
  11. agenthandler-0.93.0/agenthandler/sdk_adapters.py +303 -0
  12. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/server.py +1 -7
  13. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/streams.py +3 -3
  14. agenthandler-0.93.0/examples/a2a_agents.py +145 -0
  15. agenthandler-0.93.0/examples/mcp_server.py +72 -0
  16. agenthandler-0.93.0/examples/sdk_adapters.py +175 -0
  17. {agenthandler-0.92.0 → agenthandler-0.93.0}/npm/package.json +1 -7
  18. {agenthandler-0.92.0 → agenthandler-0.93.0}/pyproject.toml +5 -2
  19. agenthandler-0.93.0/tests/test_a2a.py +456 -0
  20. agenthandler-0.93.0/tests/test_sdk_adapters.py +372 -0
  21. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_server.py +0 -14
  22. agenthandler-0.92.0/docs/superpowers/plans/2026-06-09-hardening-pass.md +0 -1138
  23. agenthandler-0.92.0/docs/superpowers/specs/2026-06-09-hardening-pass-design.md +0 -91
  24. agenthandler-0.92.0/openclaw-plugin/openclaw.plugin.json +0 -30
  25. agenthandler-0.92.0/openclaw-plugin/package.json +0 -22
  26. agenthandler-0.92.0/openclaw-plugin/src/index.ts +0 -120
  27. agenthandler-0.92.0/openclaw-plugin/tsconfig.json +0 -12
  28. {agenthandler-0.92.0 → agenthandler-0.93.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  29. {agenthandler-0.92.0 → agenthandler-0.93.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  30. {agenthandler-0.92.0 → agenthandler-0.93.0}/.github/workflows/ci.yml +0 -0
  31. {agenthandler-0.92.0 → agenthandler-0.93.0}/.github/workflows/claude-pr-review.yml +0 -0
  32. {agenthandler-0.92.0 → agenthandler-0.93.0}/CONTRIBUTING.md +0 -0
  33. {agenthandler-0.92.0 → agenthandler-0.93.0}/LICENSE +0 -0
  34. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/approval.py +0 -0
  35. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/audit.py +0 -0
  36. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/auth.py +0 -0
  37. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/budget.py +0 -0
  38. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/builder.py +0 -0
  39. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/circuit_breaker.py +0 -0
  40. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/context.py +0 -0
  41. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/errors.py +0 -0
  42. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/guardrails/__init__.py +0 -0
  43. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/guardrails/deterministic.py +0 -0
  44. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/guardrails/llm_based.py +0 -0
  45. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/guardrails/types.py +0 -0
  46. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/openclaw.py +0 -0
  47. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/pipeline.py +0 -0
  48. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/pipeline_poml.py +0 -0
  49. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/policy.py +0 -0
  50. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/py.typed +0 -0
  51. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/reflection.py +0 -0
  52. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/replay.py +0 -0
  53. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/session.py +0 -0
  54. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/skill.py +0 -0
  55. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/store.py +0 -0
  56. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/supervisor.py +0 -0
  57. {agenthandler-0.92.0 → agenthandler-0.93.0}/agenthandler/triggers.py +0 -0
  58. {agenthandler-0.92.0 → agenthandler-0.93.0}/dashboard.html +0 -0
  59. {agenthandler-0.92.0 → agenthandler-0.93.0}/docs/architecture.svg +0 -0
  60. {agenthandler-0.92.0 → agenthandler-0.93.0}/docs/manifesto.md +0 -0
  61. {agenthandler-0.92.0 → agenthandler-0.93.0}/examples/approval_flow.py +0 -0
  62. {agenthandler-0.92.0 → agenthandler-0.93.0}/examples/audit_logging.py +0 -0
  63. {agenthandler-0.92.0 → agenthandler-0.93.0}/examples/basic.py +0 -0
  64. {agenthandler-0.92.0 → agenthandler-0.93.0}/examples/circuit_breaker.py +0 -0
  65. {agenthandler-0.92.0 → agenthandler-0.93.0}/examples/context_compression.py +0 -0
  66. {agenthandler-0.92.0 → agenthandler-0.93.0}/examples/cost_attribution.py +0 -0
  67. {agenthandler-0.92.0 → agenthandler-0.93.0}/examples/data_flows.py +0 -0
  68. {agenthandler-0.92.0 → agenthandler-0.93.0}/examples/from_config.py +0 -0
  69. {agenthandler-0.92.0 → agenthandler-0.93.0}/examples/guardrails.py +0 -0
  70. {agenthandler-0.92.0 → agenthandler-0.93.0}/examples/long_running_agent.py +0 -0
  71. {agenthandler-0.92.0 → agenthandler-0.93.0}/examples/openclaw_bridge.py +0 -0
  72. {agenthandler-0.92.0 → agenthandler-0.93.0}/examples/pii_redaction.py +0 -0
  73. {agenthandler-0.92.0 → agenthandler-0.93.0}/examples/pipeline.py +0 -0
  74. {agenthandler-0.92.0 → agenthandler-0.93.0}/examples/poml_pipeline.py +0 -0
  75. {agenthandler-0.92.0 → agenthandler-0.93.0}/examples/session_lifecycle.py +0 -0
  76. {agenthandler-0.92.0 → agenthandler-0.93.0}/examples/skill_builder.py +0 -0
  77. {agenthandler-0.92.0 → agenthandler-0.93.0}/examples/streaming.py +0 -0
  78. {agenthandler-0.92.0 → agenthandler-0.93.0}/examples/tool_scoping.py +0 -0
  79. {agenthandler-0.92.0 → agenthandler-0.93.0}/examples/triggers.py +0 -0
  80. {agenthandler-0.92.0 → agenthandler-0.93.0}/npm/README.md +0 -0
  81. {agenthandler-0.92.0 → agenthandler-0.93.0}/npm/bin/agenthandler.js +0 -0
  82. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/__init__.py +0 -0
  83. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_approval.py +0 -0
  84. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_audit.py +0 -0
  85. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_budget.py +0 -0
  86. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_circuit_breaker.py +0 -0
  87. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_connectors.py +0 -0
  88. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_context.py +0 -0
  89. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_cost_attribution.py +0 -0
  90. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_errors.py +0 -0
  91. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_guardrails.py +0 -0
  92. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_llm_decisions.py +0 -0
  93. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_observe.py +0 -0
  94. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_openclaw.py +0 -0
  95. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_pipeline.py +0 -0
  96. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_pipeline_poml.py +0 -0
  97. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_policy.py +0 -0
  98. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_redact.py +0 -0
  99. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_replay_reflection.py +0 -0
  100. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_schema_discovery.py +0 -0
  101. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_scopes.py +0 -0
  102. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_session.py +0 -0
  103. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_skill.py +0 -0
  104. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_store.py +0 -0
  105. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_streams.py +0 -0
  106. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_supervisor.py +0 -0
  107. {agenthandler-0.92.0 → agenthandler-0.93.0}/tests/test_triggers.py +0 -0
@@ -27,11 +27,6 @@ htmlcov/
27
27
  node_modules/
28
28
  openclaw-plugin/dist/
29
29
 
30
- # Stray installers / large binaries
31
- npm/*.sh
32
- *.pkg
33
- *.dmg
34
-
35
30
  # Environment
36
31
  .env
37
32
  .env.*
@@ -12,9 +12,14 @@ All notable changes to AgentHandler are documented here.
12
12
  - Test count badge in README.
13
13
 
14
14
  ### Changed
15
- - **mypy --strict** enabled across all 29 source files with zero errors. Full type annotations on every function.
15
+ - **Rebrand**: Clawboss → AgentHandler. `pip install agenthandler`.
16
+ - **MCP server mode**: `SupervisedMCPServer` exposes tools via Model Context Protocol with full supervision. `pip install agenthandler[mcp]`.
17
+ - **mypy --strict** enabled across all 30 source files with zero errors. Full type annotations on every function.
16
18
  - Python 3.13 compatibility: replaced deprecated `asyncio.get_event_loop()` in approval tests.
17
19
 
20
+ ### Removed
21
+ - `openclaw-plugin/` directory — superseded by native MCP server mode. The Python-side `OpenClawBridge` remains for backward compatibility.
22
+
18
23
  ## [0.91.0] — 2026-06-10
19
24
 
20
25
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agenthandler
3
- Version: 0.92.0
3
+ Version: 0.93.0
4
4
  Summary: A way of controlling deployed agents to keep your (and their) sanity.
5
5
  Project-URL: Homepage, https://github.com/arunvenkatadri/AgentHandler
6
6
  Project-URL: Repository, https://github.com/arunvenkatadri/AgentHandler
@@ -29,6 +29,8 @@ Provides-Extra: kafka
29
29
  Requires-Dist: aiokafka>=0.10; extra == 'kafka'
30
30
  Provides-Extra: kinesis
31
31
  Requires-Dist: aioboto3>=12.0; extra == 'kinesis'
32
+ Provides-Extra: mcp
33
+ Requires-Dist: mcp>=1.0; extra == 'mcp'
32
34
  Provides-Extra: redis
33
35
  Requires-Dist: redis>=5.0; extra == 'redis'
34
36
  Provides-Extra: server
@@ -56,9 +58,11 @@ Description-Content-Type: text/markdown
56
58
  [![Zero Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen.svg)]()
57
59
  [![Tests](https://img.shields.io/badge/tests-658-brightgreen.svg)]()
58
60
 
59
- **Stop your AI agents from going rogue and set your long acting agents up for success.** AgentHandler wraps tool calls with timeouts, budgets, circuit breakers, and audit logging so one bad tool call doesn't drain your wallet or loop forever.
61
+ *Every agent needs a handler.*
60
62
 
61
- Zero dependencies. Works with **any agent framework** — LangChain, CrewAI, AutoGen, OpenClaw, your own custom loop, whatever. Just wrap your tool calls. Includes durable sessions that survive restarts, a REST control plane, and a [dashboard](#dashboard) for managing everything in one place.
63
+ **AgentHandler is the governance layer for AI agents.** Wrap tool calls with timeouts, budgets, circuit breakers, guardrails, and audit logging — so one bad tool call doesn't drain your wallet or loop forever. MCP-native, with adapters for OpenAI Agents SDK and Claude Agent SDK.
64
+
65
+ Zero dependencies. Works with **any agent framework** — OpenAI Agents SDK, Claude Agent SDK, Mastra, LangChain, CrewAI, your own custom loop, whatever. Just wrap your tool calls. Includes durable sessions that survive restarts, a REST control plane, MCP server mode, and a [dashboard](#dashboard) for managing everything in one place.
62
66
 
63
67
  > **AgentHandler is built for long-duration agents** — agents that run for hours or days, not minutes. Read [the manifesto](docs/manifesto.md) for the full vision.
64
68
 
@@ -178,11 +182,12 @@ The Sessions tab connects to the REST control plane (`uvicorn agenthandler.serve
178
182
  AgentHandler doesn't care what framework you use. It supervises tool calls — any async or sync callable. If your agent calls tools, AgentHandler can wrap them.
179
183
 
180
184
  ```python
181
- # LangChain? Wrap your tools.
182
- # CrewAI? Wrap your tools.
183
- # AutoGen? Wrap your tools.
185
+ # OpenAI Agents SDK? Wrap your tools.
186
+ # Claude Agent SDK? Wrap your tools.
187
+ # Mastra? Wrap your tools.
188
+ # LangChain / CrewAI? Wrap your tools.
189
+ # MCP server? Built-in (see below).
184
190
  # Custom loop? Wrap your tools.
185
- # OpenClaw? There's a built-in bridge (see below).
186
191
 
187
192
  result = await supervisor.call("my_tool", my_tool_fn, **kwargs)
188
193
  ```
@@ -792,46 +797,42 @@ AgentHandler is designed to supervise untrusted agent behavior. The stateful ses
792
797
 
793
798
  **Sessions can expire.** Call `SqliteStore.delete_expired(max_age_seconds)` to clean up old sessions.
794
799
 
795
- ## OpenClaw integration
800
+ ## MCP server mode
801
+
802
+ Expose supervised tools via Model Context Protocol. Any MCP client — Claude Desktop, Claude Code, Cursor — gets governed tool access with full supervision.
796
803
 
797
- AgentHandler includes a built-in bridge for [OpenClaw](https://github.com/openclaw/openclaw). Expose your supervised tools to OpenClaw over HTTP — all supervision (timeouts, budgets, circuit breakers) applies automatically.
804
+ ```bash
805
+ pip install agenthandler[mcp]
806
+ ```
798
807
 
799
808
  ```python
800
- from agenthandler import OpenClawBridge, Skill, ToolDefinition, ToolParameter
801
-
802
- # Define your skill with tools and supervision limits
803
- skill = Skill(
804
- name="web_research",
805
- description="Research topics on the web",
806
- tools=[
807
- ToolDefinition(
808
- name="web_search",
809
- description="Search the web",
810
- parameters=[
811
- ToolParameter(name="query", type="string",
812
- description="Search query", required=True),
813
- ],
814
- ),
809
+ from agenthandler import SupervisedMCPServer, UrlGuard, RecursionDetector
810
+
811
+ server = SupervisedMCPServer(
812
+ name="my-tools",
813
+ tools={
814
+ "search": search_fn,
815
+ "write": write_fn,
816
+ "send_email": email_fn,
817
+ },
818
+ policy={
819
+ "tool_timeout": 30,
820
+ "token_budget": 50000,
821
+ "require_confirm": ["send_email"],
822
+ },
823
+ pre_guardrails=[
824
+ UrlGuard(allowlist=["*.example.com"]),
825
+ RecursionDetector(max_repeats=3),
815
826
  ],
816
- supervision={"tool_timeout": 15, "max_iterations": 5, "token_budget": 10000},
817
827
  )
818
828
 
819
- # Start the bridge
820
- bridge = OpenClawBridge(port=9229)
821
- bridge.register_skill(skill, {"web_search": my_search_fn})
822
- bridge.serve() # GET /tools, POST /execute/{name}
829
+ server.run() # stdio for Claude Desktop
830
+ # server.run(transport="streamable-http") # network mode
823
831
  ```
824
832
 
825
- Then install the TypeScript plugin from `openclaw-plugin/` into OpenClaw. The plugin auto-discovers tools from the bridge and registers them. See `examples/openclaw_bridge.py` for a full working example.
826
-
827
- You can also convert schemas without running a bridge:
833
+ Every tool call through MCP goes through the Supervisor — timeouts, budgets, circuit breakers, PII redaction, guardrails, approvals, audit, cost tracking. A capability manifest is available at `agenthandler://manifest`.
828
834
 
829
- ```python
830
- from agenthandler import to_openclaw_tool_schema, to_openclaw_manifest
831
-
832
- schema = to_openclaw_tool_schema(tool_def) # OpenClaw JSON Schema format
833
- manifest = to_openclaw_manifest(skill) # openclaw.plugin.json content
834
- ```
835
+ See `examples/mcp_server.py` for a full working example.
835
836
 
836
837
  ## Policy from config
837
838
 
@@ -13,9 +13,11 @@
13
13
  [![Zero Dependencies](https://img.shields.io/badge/dependencies-0-brightgreen.svg)]()
14
14
  [![Tests](https://img.shields.io/badge/tests-658-brightgreen.svg)]()
15
15
 
16
- **Stop your AI agents from going rogue and set your long acting agents up for success.** AgentHandler wraps tool calls with timeouts, budgets, circuit breakers, and audit logging so one bad tool call doesn't drain your wallet or loop forever.
16
+ *Every agent needs a handler.*
17
17
 
18
- Zero dependencies. Works with **any agent framework** — LangChain, CrewAI, AutoGen, OpenClaw, your own custom loop, whatever. Just wrap your tool calls. Includes durable sessions that survive restarts, a REST control plane, and a [dashboard](#dashboard) for managing everything in one place.
18
+ **AgentHandler is the governance layer for AI agents.** Wrap tool calls with timeouts, budgets, circuit breakers, guardrails, and audit logging — so one bad tool call doesn't drain your wallet or loop forever. MCP-native, with adapters for OpenAI Agents SDK and Claude Agent SDK.
19
+
20
+ Zero dependencies. Works with **any agent framework** — OpenAI Agents SDK, Claude Agent SDK, Mastra, LangChain, CrewAI, your own custom loop, whatever. Just wrap your tool calls. Includes durable sessions that survive restarts, a REST control plane, MCP server mode, and a [dashboard](#dashboard) for managing everything in one place.
19
21
 
20
22
  > **AgentHandler is built for long-duration agents** — agents that run for hours or days, not minutes. Read [the manifesto](docs/manifesto.md) for the full vision.
21
23
 
@@ -135,11 +137,12 @@ The Sessions tab connects to the REST control plane (`uvicorn agenthandler.serve
135
137
  AgentHandler doesn't care what framework you use. It supervises tool calls — any async or sync callable. If your agent calls tools, AgentHandler can wrap them.
136
138
 
137
139
  ```python
138
- # LangChain? Wrap your tools.
139
- # CrewAI? Wrap your tools.
140
- # AutoGen? Wrap your tools.
140
+ # OpenAI Agents SDK? Wrap your tools.
141
+ # Claude Agent SDK? Wrap your tools.
142
+ # Mastra? Wrap your tools.
143
+ # LangChain / CrewAI? Wrap your tools.
144
+ # MCP server? Built-in (see below).
141
145
  # Custom loop? Wrap your tools.
142
- # OpenClaw? There's a built-in bridge (see below).
143
146
 
144
147
  result = await supervisor.call("my_tool", my_tool_fn, **kwargs)
145
148
  ```
@@ -749,46 +752,42 @@ AgentHandler is designed to supervise untrusted agent behavior. The stateful ses
749
752
 
750
753
  **Sessions can expire.** Call `SqliteStore.delete_expired(max_age_seconds)` to clean up old sessions.
751
754
 
752
- ## OpenClaw integration
755
+ ## MCP server mode
756
+
757
+ Expose supervised tools via Model Context Protocol. Any MCP client — Claude Desktop, Claude Code, Cursor — gets governed tool access with full supervision.
753
758
 
754
- AgentHandler includes a built-in bridge for [OpenClaw](https://github.com/openclaw/openclaw). Expose your supervised tools to OpenClaw over HTTP — all supervision (timeouts, budgets, circuit breakers) applies automatically.
759
+ ```bash
760
+ pip install agenthandler[mcp]
761
+ ```
755
762
 
756
763
  ```python
757
- from agenthandler import OpenClawBridge, Skill, ToolDefinition, ToolParameter
758
-
759
- # Define your skill with tools and supervision limits
760
- skill = Skill(
761
- name="web_research",
762
- description="Research topics on the web",
763
- tools=[
764
- ToolDefinition(
765
- name="web_search",
766
- description="Search the web",
767
- parameters=[
768
- ToolParameter(name="query", type="string",
769
- description="Search query", required=True),
770
- ],
771
- ),
764
+ from agenthandler import SupervisedMCPServer, UrlGuard, RecursionDetector
765
+
766
+ server = SupervisedMCPServer(
767
+ name="my-tools",
768
+ tools={
769
+ "search": search_fn,
770
+ "write": write_fn,
771
+ "send_email": email_fn,
772
+ },
773
+ policy={
774
+ "tool_timeout": 30,
775
+ "token_budget": 50000,
776
+ "require_confirm": ["send_email"],
777
+ },
778
+ pre_guardrails=[
779
+ UrlGuard(allowlist=["*.example.com"]),
780
+ RecursionDetector(max_repeats=3),
772
781
  ],
773
- supervision={"tool_timeout": 15, "max_iterations": 5, "token_budget": 10000},
774
782
  )
775
783
 
776
- # Start the bridge
777
- bridge = OpenClawBridge(port=9229)
778
- bridge.register_skill(skill, {"web_search": my_search_fn})
779
- bridge.serve() # GET /tools, POST /execute/{name}
784
+ server.run() # stdio for Claude Desktop
785
+ # server.run(transport="streamable-http") # network mode
780
786
  ```
781
787
 
782
- Then install the TypeScript plugin from `openclaw-plugin/` into OpenClaw. The plugin auto-discovers tools from the bridge and registers them. See `examples/openclaw_bridge.py` for a full working example.
783
-
784
- You can also convert schemas without running a bridge:
788
+ Every tool call through MCP goes through the Supervisor — timeouts, budgets, circuit breakers, PII redaction, guardrails, approvals, audit, cost tracking. A capability manifest is available at `agenthandler://manifest`.
785
789
 
786
- ```python
787
- from agenthandler import to_openclaw_tool_schema, to_openclaw_manifest
788
-
789
- schema = to_openclaw_tool_schema(tool_def) # OpenClaw JSON Schema format
790
- manifest = to_openclaw_manifest(skill) # openclaw.plugin.json content
791
- ```
790
+ See `examples/mcp_server.py` for a full working example.
792
791
 
793
792
  ## Policy from config
794
793
 
@@ -17,7 +17,7 @@ Usage:
17
17
  print(result.error)
18
18
  """
19
19
 
20
- __version__ = "0.92.0"
20
+ __version__ = "0.93.0"
21
21
 
22
22
  from .approval import ApprovalQueue, ApprovalRequest, ApprovalStatus
23
23
  from .audit import AuditEntry, AuditLog, AuditOutcome, AuditPhase, AuditSink, JsonlAuditSink
@@ -54,6 +54,13 @@ from .policy import Action, OnFailure, Policy, ScopeRule, ToolScope
54
54
  from .redact import Redactor
55
55
  from .reflection import ReflectionCycle, ReflectionLoop, ReflectionResult
56
56
  from .replay import ReplayFrame, ReplaySummary, SessionReplay
57
+ from .sdk_adapters import (
58
+ AgentHandlerMiddleware,
59
+ openai_guardrail_adapter,
60
+ supervised_tool_registry,
61
+ wrap_claude_tool,
62
+ wrap_openai_tool,
63
+ )
57
64
  from .session import SessionManager
58
65
  from .skill import Skill, SkillStore, ToolDefinition, ToolParameter
59
66
  from .store import (
@@ -73,6 +80,16 @@ from .streams import (
73
80
  from .supervisor import SupervisedResult, Supervisor
74
81
  from .triggers import DbWatchEntry, Scheduler, WebhookTrigger
75
82
 
83
+ try:
84
+ from .mcp_server import SupervisedMCPServer
85
+ except ImportError:
86
+ pass
87
+
88
+ try:
89
+ from .a2a import A2AAgentCard, A2AClient, A2ASkill, A2ASupervisedEndpoint, A2ATask, TaskState
90
+ except ImportError:
91
+ pass
92
+
76
93
  __all__ = [
77
94
  "Policy",
78
95
  "OnFailure",
@@ -160,4 +177,19 @@ __all__ = [
160
177
  "SessionReplay",
161
178
  "ReplayFrame",
162
179
  "ReplaySummary",
180
+ # MCP
181
+ "SupervisedMCPServer",
182
+ # A2A
183
+ "A2AAgentCard",
184
+ "A2AClient",
185
+ "A2ASkill",
186
+ "A2ASupervisedEndpoint",
187
+ "A2ATask",
188
+ "TaskState",
189
+ # SDK adapters
190
+ "wrap_openai_tool",
191
+ "wrap_claude_tool",
192
+ "openai_guardrail_adapter",
193
+ "supervised_tool_registry",
194
+ "AgentHandlerMiddleware",
163
195
  ]