Skip to content

Local only MCP Server#575

Closed
AbhinRustagi wants to merge 7 commits into
siddharthvaddem:mainfrom
AbhinRustagi:feat/mcp-server
Closed

Local only MCP Server#575
AbhinRustagi wants to merge 7 commits into
siddharthvaddem:mainfrom
AbhinRustagi:feat/mcp-server

Conversation

@AbhinRustagi
Copy link
Copy Markdown
Contributor

@AbhinRustagi AbhinRustagi commented May 11, 2026

Pull Request Template

Description

Motivation

Type of Change

  • New Feature
  • Bug Fix
  • Refactor / Code Cleanup
  • Documentation Update
  • Other (please specify)

Related Issue(s)

#574

Screenshots / Video

export-1778494804267-compressed.mp4

Testing

Checklist

  • I have performed a self-review of my code.
  • I have added any necessary screenshots or videos.
  • I have linked related issue(s) and updated the changelog if applicable.

Thank you for contributing!

Adds @modelcontextprotocol/sdk and zod to support the upcoming MCP
server that lets external AI agents drive the editor over Streamable
HTTP.
types.ts holds the lifecycle types (McpServerInfo, McpServerStatus,
McpInvokeRequest/Response) the main process and renderer exchange.

toolCatalog.ts defines the surface area of the MCP server as data:
each tool's name, description, category, and zod input schema. Both
the SDK registration on the main side and the dialog's tool listing
in the renderer import this single source so they cannot drift.
- server.ts hosts a Streamable HTTP MCP server on 127.0.0.1 with a
  random port. Enforces two layers of loopback validation: the peer
  socket address and the Host header (DNS rebinding defense).
- Stubs the OAuth 2.1 + Dynamic Client Registration endpoints the MCP
  HTTP transport spec requires; the responses are well-formed but
  enforce nothing, so any local MCP client can complete the handshake.
- /authorize renders a small branded HTML page that JS-redirects to
  the client's callback URL with a fixed code.
- rendererBridge.ts forwards tool invocations to the editor window
  using correlation IDs and timeouts; replies route back via the
  matching IPC channel.
- index.ts exposes lazy singletons for both.
- handlers.ts registers mcp:start / mcp:stop / mcp:status and pushes
  state changes to the editor window over mcp:status-changed.
  Also exposes clipboard:write-text as a reliable way for the renderer
  to copy the connection URL.
- preload.ts adds window.electronAPI.mcp.{start,stop,status,
  onStatusChanged,onInvoke,reply,onOpenDialog} and writeClipboard.
- main.ts adds a Tools menu with an MCP Server entry that opens (or
  creates) the editor window and tells it to show the dialog.
- electron-env.d.ts typings track the new surface.
- toolHandlers.ts wires each MCP tool name to a handler reading and
  writing EditorState via the small McpEditorControls interface.
  Region ids come from the existing deriveNextId helper; the
  normalize/clamp rules in normalizeProjectEditor still apply since
  every edit goes through pushState.
- McpToolHost.tsx listens for mcp:invoke from main, dispatches via
  the handler map, and replies with mcp:reply. Stable controls
  reference so the map is built once.
- useMcpStatus.ts wraps start/stop/status IPC plus the
  mcp:status-changed subscription for the dialog UI.
Radix Dialog with:
- Status pill (Stopped / Starting / Running / Error) reflecting the
  live server state from useMcpStatus.
- Enable / Disable toggle that flips the server lifecycle.
- Copyable connection URL routed through the Electron clipboard
  module (navigator.clipboard fallback if the IPC path is unavailable).
- Scrollable tool catalog grouped by category, sourced from
  TOOL_DISPLAY so it stays in lockstep with what's actually registered.
Builds an McpEditorControls bag that reads editor state via refs so
handlers see live values without rebuilding the handler map, and
writes through the existing pushState so every agent edit lands in
the undo stack as its own checkpoint.

Implements captureSourceFrame (offscreen canvas + <video>) and
captureRenderedFrame (seek + waitForFrame + Pixi canvas snapshot).
exportProject returns a placeholder error pending refactor of
handleExport to accept an explicit output path.

Listens on mcp:open-dialog so the Tools menu opens the MCP dialog
inside the editor window.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a6ff7d45-3c17-45e2-b9a9-75bcbbf3ed38

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@AbhinRustagi AbhinRustagi changed the title Feat/mcp server Local only MCP Server May 11, 2026
@siddharthvaddem
Copy link
Copy Markdown
Owner

@AbhinRustagi sorry but wanted to stop and inform before you spend more time on this - mcp, agentic capabilities will not be accepted currently.

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.

2 participants