feat(mcp): add @multica/mcp server + downloadable bundle + settings page#1986
Open
prellr wants to merge 1 commit intomultica-ai:mainfrom
Open
feat(mcp): add @multica/mcp server + downloadable bundle + settings page#1986prellr wants to merge 1 commit intomultica-ai:mainfrom
prellr wants to merge 1 commit intomultica-ai:mainfrom
Conversation
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.
|
@prellr is attempting to deploy a commit to the IndexLabs Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, nopnpm 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_configfield (migration046) 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 touchesagent.mcp_configor the existing client path.agent.mcp_configWhat's new
packages/mcp/@modelcontextprotocol/sdk+zodinlined. Zero workspace deps — easily lifts into its own repo later.Dockerfile.web@multica/mcpand copies the bundled output toapps/web/public/multica-mcp.js. Next.js' standalone runtime servespublic/as-is, so/multica-mcp.jsbecomes a downloadable asset on the running install.packages/views/settings/components/tokens-tab.tsxtokens-tab.tsxcomponent into four sections: (1) personal access tokens, (2) connection details with copyableMULTICA_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/sdkandzodonly — 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 agit subtree splitaway.How to try it
~/.local/bin/multica-mcp.multica_issue_listand 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 todist/index.js(~640 KB) with shebang and node20 ESM target.pnpm --filter @multica/web typecheck— clean (consumes the expandedtokens-tab.tsxcomponent).tools/listreturns 32 tools,multica_workspace_get/multica_agent_list/multica_channel_list/multica_issue_createround-trip successfully end-to-end via Claude Code.