relative-interpreter-mcp

relative-interpreter-mcp

An MCP server that enables LLMs to act as an interpreter for the Relative service, providing tools for navigating, reading, editing, executing, and managing models through natural language.

Category
访问服务器

README

Relative — MCP Interpreter

An MCP server that lets an LLM (Claude Code, Claude Desktop, any MCP host) act as a third interpreter for the Relative service — alongside relative-interpreter-list and relative-interpreter-graph, which are browser UIs for a human. This one exposes a model as tools instead of buttons.

See DESIGN.md for why it is shaped the way it is.

Run

npm install
RELATIVE_SERVICE_URL=http://localhost:4000/api npm start

Needs a running relative service (see that repo's README.md). RELATIVE_SERVICE_URL defaults to http://localhost:4000/api.

Register it as a local stdio server. For Claude Code, in .mcp.json:

{
  "mcpServers": {
    "relative": {
      "command": "npx",
      "args": ["tsx", "/path/to/relative-interpreter-mcp/src/main.ts"],
      "env": { "RELATIVE_SERVICE_URL": "http://localhost:4000/api" }
    }
  }
}

What it gives the model

Reads return a compact outline, not JSON — names as identifiers, links as arrows, submodels summarised to a line:

Model "Switch Circuit" · 4 nodes, 3 links, 1 view · rev 0
Scope: (root)

Nodes:
  battery  const boolean = true    out out:boolean
  switch   var boolean = false     in in:boolean  out out:boolean
  circuit  fn python runtimes/python/examples/circuit.py [onUpdate]   in powered:boolean,closed:boolean  out lit:boolean
  bulb     var boolean = false     in in:boolean  out out:boolean

Links:
  battery.out -> circuit.powered  [power flow]  battery powers circuit
  switch.out -> circuit.closed    [power flow]  switch closes circuit
  circuit.lit -> bulb.in          [power flow]  circuit lights bulb

Views:
  power flow  (3 links)

One edit_model tool takes many steps, applied as a single undoable operation via the service's /batch endpoint, with later steps able to reference what earlier ones create:

{ "steps": [
  { "action": "addValueNode", "input": { "name": "Switch", "mutability": "variable",
                                         "initialValue": { "type": "boolean", "value": false } } },
  { "action": "addValueNode", "input": { "name": "Bulb", "mutability": "variable",
                                         "initialValue": { "type": "boolean", "value": false } } },
  { "action": "addView", "input": { "name": "Power" } },
  { "action": "addLinkWithEndpoints", "input": { "name": "sw-to-bulb",
      "endpointA": "Switch.out", "endpointB": "Bulb.in",
      "direction": "forward", "views": ["Power"] } }
] }

References are names, and bad ones are refused. The service's state layer is total, so a mutation aimed at something that does not exist silently succeeds; every reference is resolved and checked here first:

Step 1 (updateNode): No node "NoSuchNode" in this scope.
Available: Switch#4e64975c, Bulb#159d3b8a

Names are not unique in Relative, so an ambiguous one is an error offering name#uuidprefix handles — the same handles reads print.

Staleness is reported, not assumed. The server consumes the service's SSE stream, pushes resources/updated to subscribed hosts, and prefixes any read whose revision moved since the caller last saw it:

[changed outside this conversation since you last looked: rev 3 -> 4,
 views 0->1. The view below is current.]

Tools

Group Tools
Navigation list_models, select_model, create_model, import_model, delete_model, get_scope, enter_submodel, exit_submodel
Read get_model, get_element, get_validation, get_script_source
Edit edit_model, link_external_submodel
Execution & history run_node, undo, redo, list_snapshots, save_snapshot, restore_snapshot

Resources: relative://models, relative://models/{id} (subscribable).

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选