refactor(core): move the MCP resource models into arcade-core [TOO-1931] - #917
Closed
EricGustin wants to merge 1 commit into
Closed
refactor(core): move the MCP resource models into arcade-core [TOO-1931]#917EricGustin wants to merge 1 commit into
EricGustin wants to merge 1 commit into
Conversation
10 tasks
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
arcade-serve needs the worker format's resource shapes to serve them, and it cannot import arcade-mcp-server because the dependency runs the other way. Move the result-shaped half of the resource surface into arcade-core and re-export it from arcade_mcp_server.types, so both libraries read one definition. The request envelopes stay behind. ListResourcesRequest and its siblings extend JSONRPCRequest, which would pull JSONRPCMessage, Request and RequestId into arcade-core to no purpose: a transport that does not carry a JSON-RPC envelope needs the params object alone. ListResourcesParams is added for that params object, which arcade-mcp-server never modelled (PaginatedRequest.params is a bare dict). Also fixes a live serialization bug in the models being moved. Resource, ResourceTemplate and ResourceContents declare meta with alias="_meta", but their config never set populate_by_name, so Resource(meta=...) was accepted as an extra field and emitted as "meta". No caller reads that key, so a developer-declared _meta.ui.csp would have vanished with no error at any layer. Result already had populate_by_name, which is why the two behaved differently.
EricGustin
force-pushed
the
ericgustin/too-1931-mcp-resource-models-to-arcade-core
branch
from
August 26, 2026 06:56
b5642b7 to
1d296c5
Compare
EricGustin
deleted the
ericgustin/too-1931-mcp-resource-models-to-arcade-core
branch
August 26, 2026 06:57
11 tasks
Member
Author
|
Superseded by #923. GitHub auto-closed this when the head branch was renamed to drop protocol vocabulary from a branch name in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 of 6 in the M1 stack for Support Resources for Engine-to-Worker Leg. Linear: TOO-1931.
Why
arcade-serveneeds MCP's resource shapes to serve them on the worker protocol, and it cannot importarcade-mcp-server, because the dependency runs the other way. This moves the result-shaped half of the resource surface intoarcade-coreand re-exports it fromarcade_mcp_server.types, so both libraries read one definition.What moved, and what did not
Moved:
Result,PaginatedResult,BaseMetadata,Icon,Annotations,Cursor,Role,Resource,ResourceTemplate,ResourceContents,TextResourceContents,BlobResourceContents,ListResourcesResult,ListResourceTemplatesResult,ReadResourceResult,ReadResourceParams.The three JSON-RPC request envelopes stay behind.
ListResourcesRequestand its siblings extendJSONRPCRequest, which would pullJSONRPCMessage,RequestandRequestIdinto arcade-core to no purpose: a transport that is not JSON-RPC carries the params object alone.ListResourcesParamsis new, because arcade-mcp-server never modelled it (PaginatedRequest.paramsis a baredict[str, Any]). The class name is local; the wire shape is MCP'sPaginatedRequestParamsexactly.A live bug this fixes
Resource,ResourceTemplateandResourceContentsdeclaremetawithalias="_meta", but their config never setpopulate_by_name. Withextra="allow", that meansResource(meta=...)was silently accepted as an extra field and serialized as"meta":No MCP client reads
meta, so a developer-declared_meta.ui.cspwould have vanished with no error at any layer.Resultalready hadpopulate_by_name, which is why the two behaved differently. Fixed here with a regression test, since these are the models being moved.Verification
libs/tests.mypyclean on arcade-core and arcade-mcp-server.libs/tests/core/test_mcp_resources.py, plus a re-export identity test asserting the moved names are the same objects and the request envelopes stayed behind.