Skip to content

feat(mcp): add @multica/mcp server + downloadable bundle + settings page#1986

Open
prellr wants to merge 1 commit intomultica-ai:mainfrom
prellr:feat/mcp-server
Open

feat(mcp): add @multica/mcp server + downloadable bundle + settings page#1986
prellr wants to merge 1 commit intomultica-ai:mainfrom
prellr:feat/mcp-server

Conversation

@prellr
Copy link
Copy Markdown

@prellr prellr commented May 1, 2026

Summary

Adds an MCP (Model Context Protocol) server for Multica plus an in-product setup + reference page so users can wire it into Claude Desktop / Claude Code / Cursor / Windsurf without leaving the app.

The MCP server is shipped as a downloadable static asset from the running install. End users grab it with one curl from the new Settings → API & MCP page — no git clone, no pnpm build, version always matches the API it's talking to.

Why this is additive (not duplicative)

Upstream already has agent-side MCP client support: the agent.mcp_config field (migration 046) lets a Multica agent talk out to external MCP servers while it works. This PR adds the inverse — Multica-as-MCP-server, so external AI assistants can call in. The two directions are complementary; nothing in this PR touches agent.mcp_config or the existing client path.

Direction Who's the MCP client Who's the MCP server Status before this PR
Multica → external Multica agent Linear, GitHub, etc. Already supported via agent.mcp_config
External → Multica Claude Desktop / Code, Cursor Multica Added by this PR

What's new

Component Path What it is
MCP server packages/mcp/ Self-contained TypeScript package. 32 tools across 7 resource groups (issues, agents, channels, projects, labels, autopilots, workspace). 26 unit tests. Bundles via tsup to a single ~640 KB executable JS file with @modelcontextprotocol/sdk + zod inlined. Zero workspace deps — easily lifts into its own repo later.
Build & ship Dockerfile.web Adds a step that builds @multica/mcp and copies the bundled output to apps/web/public/multica-mcp.js. Next.js' standalone runtime serves public/ as-is, so /multica-mcp.js becomes a downloadable asset on the running install.
Settings page docs packages/views/settings/components/tokens-tab.tsx Renames the My Account → API Tokens tab to API & MCP and expands the existing tokens-tab.tsx component into four sections: (1) personal access tokens, (2) connection details with copyable MULTICA_API_URL + MULTICA_WORKSPACE_ID, (3) MCP server setup with download + register snippets prefilled with the user's actual values, (4) REST API reference — endpoint table grouped by resource (issues, channels, agents, projects, labels, autopilots, workspace, tokens) with method badges and an authenticated curl sample.

Why compartmentalize

The MCP package depends on @modelcontextprotocol/sdk and zod only — nothing from @multica/core, @multica/ui, or any other workspace package. If upstream wants to extract it (own repo, separate release cadence, third-party contributions) it's a git subtree split away.

How to try it

  1. After this lands, build & deploy as usual.
  2. Open Settings → API & MCP, create a token.
  3. Copy the curl command from the "Download the MCP server" step — lands the binary at ~/.local/bin/multica-mcp.
  4. Copy the Claude Code or Claude Desktop snippet (workspace + URL prefilled) and paste into the relevant config.
  5. Restart your AI client and prompt: "List my open Multica issues." The model should call multica_issue_list and return them.

Forward-compat note

The multica_channel_* tools and the channel endpoints in the REST API reference target endpoints introduced by the channels Phase 1 PR. They 404 cleanly on installs without channels enabled and start working as soon as Phase 1 lands — no API contract changes between the two PRs.

Test plan

  • pnpm --filter @multica/mcp typecheck — clean.
  • pnpm --filter @multica/mcp test — 26/26 pass.
  • pnpm --filter @multica/mcp build — bundles to dist/index.js (~640 KB) with shebang and node20 ESM target.
  • pnpm --filter @multica/web typecheck — clean (consumes the expanded tokens-tab.tsx component).
  • Smoke-test against a live workspace: tools/list returns 32 tools, multica_workspace_get / multica_agent_list / multica_channel_list / multica_issue_create round-trip successfully end-to-end via Claude Code.

Adds a Model Context Protocol server that lets MCP-aware AI assistants
(Claude Desktop, Claude Code, Cursor, Windsurf, etc.) orchestrate Multica
from chat. The server is shipped as a downloadable static asset from the
running install — users grab it from the new "API & MCP" settings page,
no clone-and-build required.

What's in the package
---------------------
* `packages/mcp/` — new self-contained TypeScript package. Zero deps on
  other workspace packages. Bundles via tsup to a single executable JS
  file (~640 KB with @modelcontextprotocol/sdk + zod inlined). 32 tools
  across 7 resource groups (issues, agents, channels, projects, labels,
  autopilots, workspace), backed by 26 unit tests.
* `Dockerfile.web` — adds a build step that compiles `@multica/mcp` and
  copies its bundled output to `apps/web/public/multica-mcp.js`. Next.js'
  standalone runtime serves `public/` as-is, so the running install
  exposes the binary at `/multica-mcp.js`.
* `packages/views/settings/components/api-tab.tsx` (was `tokens-tab.tsx`)
  + `settings-page.tsx` — renames the "API Tokens" sidebar entry to
  "API & MCP" and expands it into four sections:
    1. Personal access tokens (existing flow, copy refreshed to mention
       the three roles a token authenticates: REST API, MCP, CLI).
    2. Connection details — copyable `MULTICA_API_URL` and
       `MULTICA_WORKSPACE_ID` values pulled from the live API client.
    3. Model Context Protocol server — 4-step walkthrough with copy-
       paste registration snippets for Claude Code and Claude Desktop,
       prefilled with the user's actual API URL + workspace ID.
    4. REST API — endpoint reference grouped by resource (issues,
       channels, agents, projects, labels, autopilots, workspace,
       tokens) with method badges and an authenticated curl sample.

Compartmentalization
--------------------
The MCP package depends only on `@modelcontextprotocol/sdk` and `zod`.
It does NOT import from `@multica/core`, `@multica/ui`, or any other
workspace package. A future PR could lift it into its own repository
with `git subtree split` and a one-line CI without touching the rest of
the monorepo.

Forward-compatibility note
--------------------------
The `multica_channel_*` tools (and the channel endpoints documented in
the REST API reference) target endpoints introduced by the channels
Phase 1 PR. They 404 cleanly on installs without channels enabled and
start working as soon as Phase 1 lands — no API contract changes
between the two PRs.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 1, 2026

@prellr is attempting to deploy a commit to the IndexLabs Team on Vercel.

A member of the Team first needs to authorize it.

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