Command Palette

Search for a command to run...

UnylyUnyly
Весь каталог

Opencode Plugin

БесплатноНе проверен

grāmatr lifecycle plugin for OpenCode — maps OpenCode plugin events to grāmatr hooks via the connected MCP client (route_request injection, session continuity,

GitHubEmbed

Описание

grāmatr lifecycle plugin for OpenCode — maps OpenCode plugin events to grāmatr hooks via the connected MCP client (route_request injection, session continuity, git-gate).

README

grāmatr

@gramatr/opencode-plugin

grāmatr lifecycle plugin for OpenCode. Maps OpenCode's plugin events (session.created, message.updated, tool.execute.before, session.idle, session.compacted) to grāmatr hooks — pre-classifying every prompt through the remote MCP server at api.gramatr.com/mcp, restoring session continuity on start, and enforcing git-gate hard rules before destructive shell commands run. Same intelligent context engineering layer used across Claude Code, ChatGPT, Cursor, Codex, and Gemini.

What you get

  • Cheaper, faster prompts. A multi-head classification pipeline pre-routes each request and replaces the tens-of-thousands-token system prompt you'd otherwise hand-maintain. The effect compounds the longer you work.
  • Consistent behavior across sessions. The same contract — directives plus quality gates — runs on every prompt, so your AI acts the same on session 200 as on session 1.
  • Continuity across tools. A session you start in OpenCode resumes cleanly in Claude Code, Cursor, or the web — the handoff is persisted by the same backend.
  • Auditable safety rails. Per-prompt hard gates (e.g. git push --force to main is blocked locally before the tool runs).

Install

Add both entries to your opencode.json:

{
  "mcp": {
    "gramatr": {
      "type": "remote",
      "url": "https://api.gramatr.com/mcp",
      "enabled": true
    }
  },
  "plugin": [
    "@gramatr/opencode-plugin"
  ]
}

OpenCode will fetch the package from npm on next start. No global install required.

Authentication

The remote MCP connector authenticates via OAuth 2.0 Device Authorization Grant (RFC 8628). On first connect, OpenCode prompts you to visit a short URL and paste a user code — the same flow used in SSH, WSL, and CI environments where a browser redirect can't reach the client. Tokens are stored by OpenCode's MCP client; the plugin never handles raw credentials.

If you don't have a grāmatr account yet, sign up at gramatr.com.

How it works

OpenCode
   │
   ├── plugin: @gramatr/opencode-plugin  ──┐
   │                                       │ lifecycle events
   │                                       │ (session.created, message.updated, …)
   │                                       ▼
   └── mcp.gramatr (remote, OAuth) ──► api.gramatr.com/mcp
                                       (route_request, load_handoff,
                                        save_reflection, …)

The plugin is a thin connector: every grāmatr hook is invoked against the already-connected remote MCP server declared in the mcp block — there is no local binary, no execSync, no shell-out. Guidance from the server is injected into the active session as a noReply system message so the model sees it before formulating its next response.

When OpenCode's plugin API exposes a typed client.callTool(), the connector will switch to direct MCP tool invocation and drop the prompt-injection path.

Requirements

  • OpenCode with @opencode-ai/plugin ≥ 1.0.0
  • Node.js ≥ 22
  • Network access to https://api.gramatr.com/mcp

Links

License

See LICENSE in this package.

from github.com/gramatr/opencode-plugin

Установить Opencode Plugin в Claude Desktop, Claude Code, Cursor

Рекомендуется · одна команда, все IDE
unyly install opencode-plugin

Ставит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.

Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh

Или настроить вручную

Выполни в терминале:

claude mcp add opencode-plugin -- npx -y @gramatr/opencode-plugin

FAQ

Opencode Plugin MCP бесплатный?

Да, Opencode Plugin MCP бесплатный — установка в пару кликов через Unyly без оплаты.

Нужен ли API-ключ для Opencode Plugin?

Нет, Opencode Plugin работает без API-ключей и переменных окружения.

Opencode Plugin — hosted или self-hosted?

Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.

Как установить Opencode Plugin в Claude Desktop, Claude Code или Cursor?

Открой Opencode Plugin на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.

Похожие MCP

Compare Opencode Plugin with

Не уверен что выбрать?

Найди свой стек за 60 секунд

Автор?

Embed-бейдж для README

Похожее

Все в категории development