Skip to content

feat(mcp): expose hosted Postplan tools with OAuth - #23

Merged
notsuhas merged 6 commits into
mainfrom
feat/mcp
Oct 9, 2026
Merged

notsuhas merged 6 commits into
mainfrom
feat/mcp

Conversation

@notsuhas

@notsuhas notsuhas commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Adds hosted MCP at /api/mcp over Streamable HTTP, with OAuth login, PKCE, read/write consent and connection revocation. Its 13 tools use existing site permissions for publishing, source reads, comments, feedback and versions. Keeps postplan mcp as an optional local stdio adapter.

Bounds uploaded file contents and rejects unsafe paths, JSON-RPC batches and writes from read-only grants. Stable idempotency keys support retries. Owners supplying a stale expectedVersion now receive 409; owner uploads without a version still work. Account settings include MCP connections for revoking access.

Validation: 2,036 tests passed, followed by 53 focused tests after the final fixes. Typecheck, lint, format, Go tests/vet and independent security/code-quality reviews passed. A real local Worker and MCP SDK client verified OAuth consent, refresh and revocation, upload/read, idempotent retries and stale-edit rejection. Production OAuth and actual Claude/Cursor connections are not yet verified.

notsuhas and others added 5 commits October 9, 2026 19:23
Lets chat-only clients (Claude Desktop, Cursor, Codex) use Postplan
without a shell. Tools wrap the existing commands with the CLI's login:
deploy, list, comments, reply, feedback, versions, rollback, delete,
fork. Feedback wait is capped at 50s so a call can't hang. The
self-update hooks skip mcp so stdout stays protocol-only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
postplan mcp now serves both protocol generations. Requests carrying
per-request _meta get the stateless 2026-07-28 behavior (server/discover,
resultType, cache hints, -32022 for unknown versions); initialize still
works for older clients. Cancelled calls no longer get a reply.

The new read tool returns a deployed file's text, capped at 200 KB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since every served HTML page carries Postplan's injected SDK, a bare read
returned those scripts too. read now fetches ?raw=1 like --pull.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@notsuhas notsuhas changed the title feat(mcp): expose Postplan tools over stdio feat(mcp): expose hosted Postplan tools with OAuth Oct 9, 2026
@notsuhas
notsuhas marked this pull request as ready for review October 9, 2026 17:36
@notsuhas
notsuhas merged commit 3f00452 into main Oct 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant