This CodeMirror extension implements the Model Context Protocol (MCP), offering features like resource and prompt autocompletion, resource decorations, and customizable theme support for enhanced text editing. This CodeMirror extension implements
A CodeMirror extension implementing the Model Context Protocol (MCP) for resource mentions and prompt commands. It enhances text editors with features like autocomplete for @resource
mentions (Resource Completion) and /prompt
commands (Prompt Completion). Visual styling (Resource Decorations) and click handling are provided for @resource
mentions, along with customizable themes (Theme Support).
Install via npm install @marimo-team/codemirror-mcp @modelcontextprotocol/sdk
or pnpm add @marimo-team/codemirror-mcp @modelcontextprotocol/sdk
.
Requires @codemirror/view
, @codemirror/state
, and @modelcontextprotocol/sdk
.
Integrate with mcpExtension
, providing a transport
(e.g., WebSocketClientTransport
) and optional configurations like logger
, clientOptions
, and onResourceClick
for custom actions. The extractResources
function helps extract resource data from the editor state.
Use @resource-uri
syntax for resource references, benefiting from visual decorations, click handling, hover tooltips, and theme customization.
Utilize /command
syntax for prompt commands with autocomplete.
pnpm install
, pnpm test
, and pnpm dev
are used for development tasks.
MIT
marimo-team/codemirror-mcp
January 9, 2025
March 27, 2025
TypeScript