vikunja/pkg/modules/mcp
kolaente a0116749d1 feat(mcp): add resource registry and dispatcher
Define the Op bitmask, the Resource struct, the package-level Register
function, and the Dispatch entry point that future tasks will use to
expose CRUD resources over MCP. No resources are registered yet.

Op carries the CRUD-op identity, knows its api-token permission string
(matching apiTokenRoutes exactly), and knows its tool-name suffix.
Resource.Inputs maps each enabled op to a pointer-to-zero of the wrapper
type the dispatcher will allocate and unmarshal into. Register validates
the resource shape and populates a tool-name lookup table so the
dispatcher never has to string-parse names like task_comments_read_all.

Dispatch threads the user from ctx, allocates a fresh wrapper, unmarshals
arguments, asks the wrapper to copy itself onto a fresh model via the
inputAdapter seam (which Task 4 will populate with real implementations),
and forwards to the corresponding handler.Do* function. The Do* calls go
through a swappable crudFuncs struct so the unit tests can verify
dispatch routing without standing up the database.
2026-05-26 23:20:04 +02:00
..
context.go feat(mcp): add streamable-http endpoint skeleton 2026-05-26 23:08:45 +02:00
dispatcher.go feat(mcp): add resource registry and dispatcher 2026-05-26 23:20:04 +02:00
dispatcher_test.go feat(mcp): add resource registry and dispatcher 2026-05-26 23:20:04 +02:00
mcp.go feat(mcp): add streamable-http endpoint skeleton 2026-05-26 23:08:45 +02:00
registry.go feat(mcp): add resource registry and dispatcher 2026-05-26 23:20:04 +02:00
registry_test.go feat(mcp): add resource registry and dispatcher 2026-05-26 23:20:04 +02:00