better mcp support

This commit is contained in:
timka123 committed 2026-11-23 17:09:42 +03:00
1 parent 3fde449ea7
commit 2b3518f873
6 files changed
+164 -11

No files matched your search

+8
View File
@@ -648,7 +648,15 @@ async def test_agent_builtin_mcp_tools_and_cimd_oauth_flow(tmp_path):
res_cimd = await registry2.execute("mcp_connect", {"source": f"zenmoney {base_url}/mcp"})
assert "oauth2/authorize/" in res_cimd
assert "client_id=https%3A%2F%2Fexample.org%2Fhomeagent-client.json" in res_cimd
assert "scope=all" in res_cimd
# Case 3: Persisting default_client_metadata_url via set_default_client_metadata_url survives restart
manager2.set_default_client_metadata_url("https://example.org/custom-client.json")
settings3 = Settings(DATA_DIR=tmp_path / "case2", MCP_CONFIG_FILE=tmp_path / "none.json")
manager3 = MCPConnectorManager(settings=settings3, registry=ToolRegistry())
assert manager3.auth_manager.default_client_metadata_url == "https://example.org/custom-client.json"
await manager2.close()
await manager3.close()
finally:
await runner.cleanup()