packages/lsp-tools-mcp/README.md
Standalone Language Server Protocol tools exposed as a stdio MCP server.
This package is the upstream source of truth for downstream plugins. In oh-my-openagent, it is vendored in-tree under packages/lsp-tools-mcp/ so CI and release jobs do not need extra checkout initialization:
| Project | Path | Role |
|---|---|---|
| codex-lsp | packages/lsp-tools-mcp/ | Codex plugin that ships these LSP MCP tools plus a Codex-specific PostToolUse diagnostics hook. |
oh-my-openagent (a.k.a. oh-my-opencode) | packages/lsp-tools-mcp/ | OpenCode plugin that registers this server as a built-in Tier-1 stdio MCP. Exposes lsp_diagnostics, lsp_goto_definition, lsp_find_references, lsp_symbols, lsp_prepare_rename, lsp_rename, and lsp_status to all agents. |
If you fix or extend the LSP runtime here, downstreams should sync the vendored package source rather than carrying divergent forks.
npm install
npm run check
npm test
npm run build
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | node dist/cli.js mcp
This server exposes the following tools:
lsp.statuslsp.diagnosticslsp.goto_definitionlsp.find_referenceslsp.symbolslsp.prepare_renamelsp.renameTool aliases are also available for compatibility:
lsp_statuslsp_diagnosticslsp_goto_definitionlsp_find_referenceslsp_symbolslsp_prepare_renamelsp_renameWhen an MCP host registers this server under the name lsp (the default in both downstreams), the tools are exposed to agents as lsp_status, lsp_diagnostics, and so on, matching the alias names above.
Default config paths (matches codex-lsp's historical layout):
.codex/lsp-client.json~/.codex/lsp-client.jsonPath overrides via environment variables:
LSP_TOOLS_MCP_PROJECT_CONFIGLSP_TOOLS_MCP_USER_CONFIGExamples (oh-my-openagent points the project config at .opencode/lsp.json via the env var):
LSP_TOOLS_MCP_PROJECT_CONFIG=.opencode/lsp.json node dist/cli.js mcp
LSP_TOOLS_MCP_USER_CONFIG=.opencode/lsp.json node dist/cli.js mcp
Example config file:
{
"lsp": {
"typescript": {
"command": ["typescript-language-server", "--stdio"],
"extensions": [".ts", ".tsx", ".js", ".jsx"]
}
}
}
src/lsp/* standalone LSP runtime (process management, JSON-RPC transport, configuration, diagnostics, workspace edits)src/tools.ts MCP tool definitions and handlerssrc/mcp.ts stdio MCP server entry and registrationsrc/cli.ts standalone CLI entry (mcp subcommand only)npm install
npm run check
npm test
npm pack --dry-run