Skip to content

Add native MCP endpoint with per-user API tokens - #1939

Closed
plusky wants to merge 32 commits into
SUSE:masterfrom
plusky:mcp-endpoint
Closed

plusky wants to merge 32 commits into
SUSE:masterfrom
plusky:mcp-endpoint

Conversation

@plusky

@plusky plusky commented Oct 12, 2026

Copy link
Copy Markdown

Exposes the app over Model Context Protocol at POST /mcp (stateless Streamable HTTP via the official mcp gem): project/episode search and reads plus posting updates and joining projects, every call authorized as the calling user through the existing Ability. Headless clients authenticate with digest-stored Bearer API tokens minted in profile settings after the normal login; the endpoint also accepts the session.

Verified: 215 rspec examples green, rubocop clean, endpoint handshake exercised over HTTP, native open-code-review pass with all high/medium findings addressed. Note: adds the missing can :read, Episode rule so the episode listing tools (and the episode pages, which authorize through the same Ability) behave like the other public listings.

plusky added 21 commits October 12, 2026 19:02
ListProjects, GetProject, SearchProjects (LIKE-based, Sphinx upgrade
noted in code) and ListEpisodes tools with uniform-denial authz and
JSON-round-tripped specs.
Member-scoped create_update via Update.create!, idempotent join via
join!, uniform denial for guests and strangers, with specs.

@pdostal pdostal left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main blocker is the production Host check (inline, mcp_controller.rb:25). The other comments are smaller.

Comment thread app/controllers/mcp_controller.rb Outdated
Comment thread app/controllers/mcp_controller.rb Outdated
Comment thread app/controllers/mcp_controller.rb Outdated
Comment thread app/mcp/mcp_auth.rb Outdated
Comment thread app/controllers/mcp_controller.rb
Comment thread app/mcp/search_projects_tool.rb Outdated
Comment thread app/controllers/mcp_controller.rb Outdated
Comment thread app/views/users/edit.html.haml Outdated
Comment thread app/views/users/tokens.html.haml
Comment thread app/models/ability.rb

@bzoltan1 bzoltan1 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really good stuff

@hennevogel

Copy link
Copy Markdown
Member

Okay first things first, general questions...

  1. Why use the mcp framework if all you do is invent a json API to things?
    1.1. Why invent your own authorization in it?
    1.2. Why invent your own authentication in it?

@plusky

plusky commented Oct 13, 2026

Copy link
Copy Markdown
Author

Superseded by a stacked split per CONTRIBUTING (small blocks, signed commits with Assisted-by trailers): #1942 (endpoint + read tools), #1943 (API tokens + bearer auth, carries a migration), #1944 (write tools + docs). Same code you both already reviewed, plus the rebase onto current master.

@plusky plusky closed this Oct 13, 2026
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.

4 participants