refactor: adopt toolregistry-server 0.4.0 App/ServerIdentity pattern#64
Conversation
Replace toolregistry-server 0.3.x internal API usage with the public App/ServerIdentity pattern from 0.4.0: - New app.py: UXarrayApp(App) with UXARRAY_IDENTITY and prepare_registry() - Remove server.py — all server logic consolidated into app.py - CLI gains `uxarray-mcp openapi` subcommand for REST serving - cmd_serve uses UXarrayApp.serve_mcp() directly - Bump toolregistry-server dependency to >=0.4.0 - Update test imports accordingly make_registry() and make_mcp_server() remain available from uxarray_mcp.app for test and scripting use. All 67 server/CLI/vector-calc tests pass.
ae254eb to
98f1c33
Compare
|
@rajeeja PR is ready — CI all green (7/7). This is the 0.4.0 update I mentioned on Slack. Summary of what changed: Architecture: replaces the internal New capability: What's untouched: all your domain code (setup, doctor, endpoints, install-claude, tools, remote, registry) — zero changes. Re: the Argonne deployment discussion — the |
|
Two proposals for your consideration: 1. CLI structure — align with toolregistry ecosystemNow that we serve both MCP and OpenAPI, the CLI could mirror the pattern used by
2. Project rename:
|
|
Merging the refactor — great cleanup. On the rename: project's too young to lock identity — good on flagging this, will think a bit more along these lines.. |
rajeeja
left a comment
There was a problem hiding this comment.
Approved — clean refactor, all CI green, zero domain-code changes.
Summary
Replaces internal
toolregistry-server0.3.x API usage with the publicApp/ServerIdentitypattern from 0.4.0.app.py:UXarrayApp(App)subclass withUXARRAY_IDENTITY(ServerIdentity) andprepare_registry()— single entry point for building the tool surfaceserver.py: delegates toUXarrayAppinstead of manually wiringRouteTable→create_mcp_server→asyncio.run(run_stdio/sse/http)toolregistry-server>=0.4.0: old import paths (toolregistry_server.mcp) no longer exist in 0.4.0No changes to
registry.py,cli.py, or any tool functions. Backward-compatible:make_registry(),make_mcp_server(), andserver.run()still work.This aligns with how toolregistry-hub uses the server library.
Test plan
python -m uxarray_mcpstill starts stdio server