Phase 8f-2: Rewrite MCP tools to wrap SDK + add block tools #22
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-mcp#22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lineage
plan-2026-02-26-tf-modularize-postgres→ Phase 8 (SDK + MCP Rewrite) → Phase 8f (MCP Rewrite) → Phase 8f-2 (MCP Rewrite Core)Repo
forgejo_admin/pal-e-docs-mcpUser Story
As an AI agent on the pal-e platform
I want all MCP tools to wrap the SDK (not raw httpx) and 7 new tools for blocks + delete_sprint
So that I can interact with knowledge at the block level (90% token reduction) and the full SDK surface is available
Context
pal-e-docs-sdkv0.1.0 is now published on Forgejo PyPI (8f-1 complete). The SDK has 32 methods across 8 mixins. The MCP server currently has 26 tools making raw httpx calls (~794 lines). After this rewrite: 32 tools wrapping SDK methods (~250 lines). 100% SDK coverage.The 7 new tools are the payoff — 6 block tools (get_note_toc, list_blocks, get_section, update_block, create_block, delete_block) enable agents to work at sub-note granularity. Plus delete_sprint for full lifecycle.
Reference pattern:
woodpecker-mcpwrappingwoodpecker-sdk— identical architecture. Read~/woodpecker-mcp/src/woodpecker_mcp/server.pyfor the proven_ok(data: Any)pattern.File Targets
Files to modify:
src/pal_e_docs_mcp/server.py— swap httpx.Client for PalEDocsClient, change _ok/_error_response signaturessrc/pal_e_docs_mcp/tools/notes.py— rewrite 7 tools to wrap SDKsrc/pal_e_docs_mcp/tools/sprints.py— rewrite 10 tools + add delete_sprintsrc/pal_e_docs_mcp/tools/links.py— rewrite 2 toolssrc/pal_e_docs_mcp/tools/projects.py— rewrite 2 toolssrc/pal_e_docs_mcp/tools/repos.py— rewrite 3 toolssrc/pal_e_docs_mcp/tools/tags.py— rewrite 1 toolsrc/pal_e_docs_mcp/tools/__init__.py— add blocks module registrationpyproject.toml— replace httpx with pal-e-docs-sdk, bump version to 0.2.0, add Forgejo PyPI indexFiles to create:
src/pal_e_docs_mcp/tools/blocks.py— 6 new block toolsFiles NOT to touch:
src/pal_e_docs_mcp/__init__.py— no changes neededsrc/pal_e_docs_mcp/__main__.py— no changes neededAcceptance Criteria
get_client()replaced withget_sdk()returningPalEDocsClient_ok(data: Any)takes parsed dict/list, returnsjson.dumps(data, indent=2), returns{"ok": true}for None_error_response()catchesPalEDocsErrorhierarchy (NotFoundError, ValidationError, ServerError)get_sdk().method_name()tools/blocks.py: get_note_toc, list_blocks, get_section, update_block, create_block, delete_blockpal-e-docs-sdk>=0.1.0, version bumped to 0.2.0uv run --directoryresolves the SDKruff checkandruff format --checkpassuv run --directory ~/pal-e-docs-mcp python -m pal_e_docs_mcp(ctrl-c after startup)Test Expectations
get_note_toc("plan-2026-02-26-tf-modularize-postgres")— should return heading listget_section("plan-2026-02-26-tf-modularize-postgres", "phases")— should return phase tableget_note("agent-workflow"),list_tags(),search_notes(query="CNPG")Constraints
search_notes: MCPquery→ SDKqcreate_note/update_note: MCPcontent→ SDKhtml_content; MCPtagsCSV → SDKlist[str]; MCPproject→ SDKproject_slugupdate_note_links: MCPtarget_slugsCSV → SDKlist[str]create_sprint: defaultstatus="planning"when not providedadd_sprint_item: defaultposition=0; MCPlabelsCSV → SDKlist[str]update_sprint: only pass fields explicitly provided (SDK uses_UNSETsentinel)bulk_move_items:json.loads(items)for the JSON string → list[dict][tool.uv.index]in pyproject.toml or equivalent souvresolvespal-e-docs-sdkfromhttps://forgejo.tail5b443a.ts.net/api/packages/forgejo_admin/pypi/simpleChecklist
Related
phase-postgres-8f2-mcp-rewrite-core— phase note in pal-e-docsphase-postgres-8f-mcp-rewrite— parent phase with full audit findingsproject-pal-e-docs— project page