mirror of
https://github.com/go-vikunja/vikunja.git
synced 2026-07-15 14:22:28 -05:00
Wires the projects resource into the MCP server end-to-end. The five project tools (create, read_one, read_all, update, delete) are now visible in tools/list and dispatch through handler.Do* like the REST layer. - Add ProjectCreateInput / ProjectUpdateInput in inputs.go with jsonschema tags covering only the writable fields the model honours (title, description, identifier, hex_color, parent_project_id, position, is_archived, is_favorite); computed fields like Owner and MaxPermission are intentionally absent so the SDK-reflected schema stays narrow. - Add resources.go with a sync.Once-guarded RegisterResources(), and an installTools helper that registers tools per (resource, op) on the *mcp.Server via a generic addTool[In inputAdapter] helper. The handler maps domain failures (permission denials, missing rows, validation) to IsError tool results per the SDK convention. - Add DispatchTyped in dispatcher.go so the AddTool handler can hand a pre-unmarshalled wrapper to the dispatcher without a JSON round-trip. The existing Dispatch (raw JSON path) delegates to a shared dispatchPrepared. - Wire RegisterResources() + installTools() into newServer() so each new MCP session inherits the static tool set. - Add fixture token 11 (mcp:access + projects:*) for the full-scope integration tests; bump TestAPIToken_ReadAll's expected count. - Refresh TestMCP_ToolsListEmpty into TestMCP_ToolsListReturnsRegisteredResources, asserting the five projects_* tools are present (Task 6 will introduce scope-based filtering of this list). - Add pkg/webtests/mcp_projects_test.go covering tools/list, create/read_one/read_all/update/delete happy paths, schema-validation failure on missing required title, permission denial on a forbidden project, and nonexistent-id lookup.