@magic-comment/mcp
v0.3.1
Published
MagicComment MCP server — read and update user comments from your AI agent. By Magic Team.
Readme
@magic-comment/mcp
MagicComment MCP server — let your AI coding agent read user feedback and close the loop (status / reply) directly from its MCP client. By Magic Team.
Quick start
# run the server (what MCP clients invoke)
npx @magic-comment/mcp@latest
# write the config for a client
npx @magic-comment/mcp@latest init --client codexClients: codex, claude, cursor, vscode, gemini, opencode.
Configuration (env)
| Var | Purpose |
| --- | --- |
| MAGIC_COMMENT_SERVER_URL | Collaboration server URL (default ws://localhost:4100). |
| MAGIC_COMMENT_API_KEY | Secret key (sk_) — used for reads and writes. |
| MAGIC_COMMENT_PROJECT_ID | Optional default project id. |
| MAGIC_COMMENT_REVIEW_ID | Optional review override; otherwise uses the project selection. |
| MAGIC_COMMENT_AGENT | Optional model/provider hint for model-agnostic clients, e.g. codex for opencode using Codex. |
The secret key is read from the environment only — never a tool argument.
Tools
| Tool | What it does |
| --- | --- |
| list_comment_threads | List feedback threads for a project review (filter by page/status). |
| get_comment_thread | Full thread with messages + anchored element context. |
| list_review_pages | Pages of a review with thread counts. |
| set_comment_thread_status | Move a thread to In progress or To review (secret key). |
| reply_to_comment_thread | Reply on a thread (secret key). |
| get_install_command | The command + config to install this server in a client. |
| get_project_config | Resolved config (never returns the secret). |
Transport: stdio by default (stdout is reserved for the MCP protocol; logs go to stderr).
Recommended agent loop
- Read the thread (
get_comment_thread) to understand the request. - Apply the fix in the codebase.
- Reply with a summary (
reply_to_comment_thread) — a brief note of what you changed, written in the reviewer's language. Replies are attributed to your agent (Claude Code, Cursor, VS Code, …) with its name and logo. - Move the thread to review (
set_comment_thread_status) once the reviewer has that context.
Example client config (Cursor ~/.cursor/mcp.json)
{
"mcpServers": {
"magic-comment": {
"command": "npx",
"args": ["-y", "@magic-comment/mcp"],
"env": {
"MAGIC_COMMENT_SERVER_URL": "wss://comments.example.com",
"MAGIC_COMMENT_API_KEY": "sk_..."
}
}
}
}Example client config (opencode ~/.config/opencode/opencode.json)
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"magic-comment": {
"type": "local",
"command": ["npx", "-y", "@magic-comment/mcp"],
"enabled": true,
"environment": {
"MAGIC_COMMENT_SERVER_URL": "wss://comments.example.com",
"MAGIC_COMMENT_API_KEY": "sk_...",
"MAGIC_COMMENT_AGENT": "codex"
}
}
}
}MAGIC_COMMENT_AGENT is useful for opencode because the MCP handshake only
identifies the client as opencode; it does not reliably tell us which model is
selected. Set it to codex, claude, gemini, etc. when you want the reply to
use a provider/model logo instead of the generic agent icon.
Generated configs (and get_install_command output) always contain the
"sk_..." placeholder — substitute your real secret key from the
MAGIC_COMMENT_API_KEY environment variable. Keep any file holding the real
key out of version control.
