Agent setup (MCP)
The language server also runs as an MCP server, so coding agents get MeTTa intelligence as a tool: go to definition, find references, hover, document and workspace symbols, go to implementation, and the call hierarchy, through one lsp tool with an operation discriminator. It is the stdio process node dist/mcp/server.js, and it takes its workspace from the client's working directory.
lsp_simplify returns an equality-saturation edit with a replayed MeTTa proof. Set apply: true to write it. lsp_deduplicate finds exact and alpha-equivalent expression clones without changing files. The metta_simplify and metta_deduplicate names are agent-facing aliases.
One command
npm run setup:mcp # print the config for every client
npm run setup:mcp -- --claude # register with Claude Code (claude mcp add, user scope)
npm run setup:mcp -- --codex # add it to ~/.codex/config.toml
npm run setup:mcp -- --all # bothApplying is idempotent: an existing registration is left alone.
The Claude Code and Codex modes also install the complete skills/metta-lsp directory, including agents/openai.yaml. Set CLAUDE_CONFIG_DIR or CODEX_HOME to install into a non-default agent root.
OmegaClaw
OmegaClaw does not consume MCP client config. Install the MeTTa-LSP integration into a checkout that has the Python plugin API:
npm run compile
npm run setup:omegaclaw -- /path/to/OmegaClaw-CoreThe installer adds a managed metta_lsp entry to config/plugins.yaml. Its location points at omegaclaw/plugin in this MeTTa-LSP checkout. OmegaClaw's Python loader imports metta_lsp.py, retains it in the plugin registry, and calls loadOmegaClawPlugin(). Build MeTTa-LSP before starting OmegaClaw, and rerun the installer if you move the MeTTa-LSP checkout.
The plugin API currently registers communication channels and LLM providers. It has no skill-registration callback, and the MeTTa plugin loader is not implemented. The installer therefore keeps a small managed MeTTa layer:
- It copies
src/skills_metta_lsp.mettainto the OmegaClaw checkout. - It adds one managed import to
lib_omegaclaw.metta. - It advertises the wrappers through the existing
getSkillscatalogue.
Use --skill-registry to convert the closed catalogue to skill-doc equations before registering the wrappers. The default mode leaves OmegaClaw's catalogue shape intact. Both modes are idempotent and write a receipt.
The integration is reversible:
npm run setup:omegaclaw -- /path/to/OmegaClaw-Core --uninstallThe Python bridge remains external. Uninstall removes the plugin record, copied wrapper, managed imports, catalogue entries, backups, and receipt.
Or paste it yourself
Claude Code
claude mcp add -s user metta-lsp -- node /path/to/metta-ts-lsp/dist/mcp/server.jsCodex — ~/.codex/config.toml
[mcp_servers."metta-lsp"]
command = "node"
args = ["/path/to/metta-ts-lsp/dist/mcp/server.js"]
startup_timeout_sec = 120.0Generic MCP client (Claude Desktop, Cursor, an mcp.json)
{
"mcpServers": {
"metta-lsp": {
"command": "node",
"args": ["/path/to/metta-ts-lsp/dist/mcp/server.js"]
}
}
}