MCPSERV.CLUB
marimo-team

codemirror-mcp

MCP Server

MCP-powered CodeMirror extension for resource mentions and prompt commands

Active(80)
77stars
0views
Updated 23 days ago

About

A lightweight CodeMirror plugin that adds Model Context Protocol support, enabling autocomplete, decoration, and click handling for @resource mentions and /prompt commands within the editor.

Capabilities

Resources
Access data sources
Tools
Execute functions
Prompts
Pre-built templates
Sampling
AI model interactions

codemirror‑mcp Overview

codemirror‑mcp is a lightweight Model Context Protocol (MCP) extension for the CodeMirror editor that bridges in‑editor text editing with AI assistants. It lets developers embed resource mentions () and prompt commands () directly into their code or prose, enabling a seamless workflow where AI agents can read, interpret, and act upon contextual information without leaving the editor.

The core problem this MCP solves is the seamless context transfer between a human developer’s working environment and an external AI service. Traditional approaches require copying text or manually attaching metadata, which is error‑prone and breaks the flow of coding. codemirror‑mcp automates this by providing autocomplete, visual decorations, and click handlers that turn plain text into rich, actionable references. When a developer types , the editor offers a list of available resources; selecting one automatically inserts a properly formatted URI, highlights it visually, and makes it clickable. Hovering over the mention shows a tooltip with details such as type or description, giving instant context to both the developer and any AI model that processes the prompt.

Key features of codemirror‑mcp include:

  • Resource Completion & Decoration – Autocompletion for mentions, visual styling, and interactive click handling that can open the resource in a new tab or trigger custom logic.
  • Prompt Completion – Autocompletion for commands, allowing developers to invoke predefined AI actions (e.g., generate code, explain a snippet) with minimal typing.
  • Customizable Theme Support – The extension respects the editor’s theme, enabling consistent styling across projects.
  • Transport Flexibility – The MCP client can be wired to any WebSocket transport, making it agnostic to the underlying AI server implementation.

Typical use cases include:

  • AI‑assisted coding: A developer writes a function, tags related documentation or data files with , and submits the snippet to an AI assistant that can fetch those resources on demand.
  • Collaborative documentation: Teams embed references to design documents or APIs, and AI tools can auto‑populate explanations or update links.
  • Rapid prototyping: Prompt commands like can be inserted to trigger code generation or testing directly from the editor.

Integration into existing workflows is straightforward: developers add to their CodeMirror configuration, provide a WebSocket transport to an MCP server, and optionally hook into the callback for custom behaviors. The extension exposes an helper that parses the editor content, enabling developers to build prompts that include all referenced resources automatically.

Overall, codemirror‑mcp offers a clean, developer‑friendly bridge between text editors and AI services. By turning ordinary text into rich, machine‑readable context, it reduces friction in AI‑driven development and empowers teams to leverage advanced language models directly within their preferred coding environment.