Repository navigation
Description
Part of #4859.
Motivation
MCP Resources are entirely unimplemented (confirmed: zero matches for resources/list/resources/read in the mcp package; capabilities in handleInitialize advertises only tools). Serving schema as a Resource lets clients auto-load structure without spending a tool-call turn on get_schema every session. Justification: #4 structured shaping, delivered via the correct protocol primitive rather than another tool — directly addresses the tool-count-discipline principle from #4859.
Proposed design
- Implement
resources/listandresources/readin bothMCPHttpHandlerandMCPStdioServer. - Advertise
capabilities.resources = {listChanged: false, subscribe: false}inhandleInitialize. - Resource URI scheme:
arcadedb://{database}/schema. resources/listenumerates one resource per database the authenticated user can access (respectingMCPConfiguration.isUserAllowed/allowedUsers).resources/readreturns the same JSONget_schemacurrently produces — refactorGetSchemaToolto extract a shared static schema-building helper, called by both the tool and the resource handler (avoid duplicating logic).- Keep the
get_schematool for backward compatibility; docs should note Resources as the preferred path for clients that support it.
Acceptance criteria
-
resources/listandresources/readrespond correctly over both HTTP and stdio transports. -
initializeresponse advertises theresourcescapability. - Schema content is identical between
get_schematool output and the resource'sresources/readcontent (verified by a test asserting equality). - Access control matches
get_schema's existing behavior (same users, same databases). - Tests added to
MCPServerPluginTest/MCPStdioServerTest; docs updated.
Files to touch
MCPHttpHandler.java, MCPStdioServer.java, server/src/main/java/com/arcadedb/server/mcp/tools/GetSchemaTool.java (refactor for reuse), tests, docs.
Dependencies
None — can proceed in parallel with all tool issues.
Effort estimate
M — new protocol primitive across two transports, capability advertisement, refactor for shared logic.
Activity
feat(mcp): expose schema as a Resource at arcadedb://{database}/schema (
feat(mcp): expose schema as a Resource at arcadedb://{database}/schema (