codemirror-mcp

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

65
0

codemirror-mcp

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).

Installation

Install via npm install @marimo-team/codemirror-mcp @modelcontextprotocol/sdk or pnpm add @marimo-team/codemirror-mcp @modelcontextprotocol/sdk.

Peer Dependencies

Requires @codemirror/view, @codemirror/state, and @modelcontextprotocol/sdk.

Usage

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.

Resources

Use @resource-uri syntax for resource references, benefiting from visual decorations, click handling, hover tooltips, and theme customization.

Prompts

Utilize /command syntax for prompt commands with autocomplete.

Development

pnpm install, pnpm test, and pnpm dev are used for development tasks.

License

MIT

Repository

MA
marimo-team

marimo-team/codemirror-mcp

Created

January 9, 2025

Updated

March 27, 2025

Language

TypeScript

Category

Developer Tools