@onrelay/mcp
v0.7.0
Published
Relay MCP server for local AI coding tools
Downloads
1,723
Readme
Relay MCP
Relay MCP exposes Relay project context to MCP-compatible coding tools.
Install
npx @onrelay/wizardRelay defaults to local stdio installs. The wizard writes each client's native config format instead of forcing a generic shared JSON file, and it auto-installs client-native instructions, rules, hooks, or skills where those surfaces are officially supported.
For manual local MCP config, point your client at:
npx -y -p @onrelay/mcp relay-mcpThe relay-mcp binary reads Relay credentials from ~/.relay/mcp.json or RELAY_API_TOKEN.
Hook-capable clients
Relay installs extra client setup only where the client has an official hook surface.
- Claude Code:
PreCompact,SessionEnd,Stop,StopFailure - Gemini CLI:
PreCompress,SessionEnd,AfterAgent
Relay does not promise a universal pre-rate-limit save hook. The fallback model is best-effort pre-loss protection: native hooks where supported, opportunistic server sweeps, and explicit checkpoints for hookless clients.
Public tools
Relay exposes five MCP tools so coding agents get a small prompt footprint:
get_brief: session-start continuityrecall: memory search, state inspection, source tracing, sessions, activity, and briefssave: session writeback, checkpoints, memory cleanup, state updates, and brief/session maintenancelist_projects: project disambiguationset_current_project: session-local project pinning
Legacy split tools are folded into recall and save rather than advertised as
separate MCP tools.
Behavior bridges
Relay also installs behavior guidance by client so agents use Relay cheaply and autonomously:
- Claude Code: managed
CLAUDE.mdblock + hooks - Codex: managed user
AGENTS.mdblock - Cursor:
.cursor/rules/relay.mdc - Windsurf:
.windsurf/rules/relay.md - Gemini CLI: managed
GEMINI.mdblock + hooks - OpenCode: managed
instructionsentries + project skill - VS Code / Copilot: managed
.github/copilot-instructions.mdblock
The default agent flow is:
- start or resume with
get_brief - only call
list_projectsandset_current_projectif Relay reports ambiguity - use
recallbefore high-impact decisions when local context is incomplete - if recall finds nothing, investigate locally and save only confirmed durable findings
- use
saveonly at meaningful boundaries or for clearly confirmed durable facts - use
saveto archive or correct stale, completed, contradicted, or superseded context
Troubleshooting
- If Relay MCP keeps opening the wrong project, remove the pinned
projectIdfrom~/.relay/mcp.jsonand restart your MCP client so project auto-detection can run again. - You can always force a specific project by setting
RELAY_PROJECT_IDin the client environment.
Publish
pnpm release:dry-run
pnpm release:mcp