Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,22 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive

- name: Setup Node ${{ matrix.node }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
cache: npm

- name: Bootstrap lsp-tools-mcp submodule
shell: bash
run: |
cd packages/lsp-tools-mcp
npm ci
npm run build

- name: Install dependencies
run: npm ci

Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
submodules: recursive

- name: Setup Node 22
uses: actions/setup-node@v6
Expand All @@ -28,6 +30,13 @@ jobs:
registry-url: https://registry.npmjs.org
cache: npm

- name: Bootstrap lsp-tools-mcp submodule
shell: bash
run: |
cd packages/lsp-tools-mcp
npm ci
npm run build

- name: Install dependencies
run: npm ci

Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "packages/lsp-tools-mcp"]
path = packages/lsp-tools-mcp
url = https://github.com/code-yeongyu/lsp-tools-mcp.git
branch = main
2 changes: 1 addition & 1 deletion .mcp.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"mcpServers": {
"lsp": {
"command": "node",
"args": ["./dist/cli.js", "mcp"],
"args": ["./packages/lsp-tools-mcp/dist/cli.js", "mcp"],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Point .mcp.json at the packaged root CLI, not the submodule path that is excluded from the published tarball.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .mcp.json, line 5:

<comment>Point `.mcp.json` at the packaged root CLI, not the submodule path that is excluded from the published tarball.</comment>

<file context>
@@ -2,7 +2,7 @@
 		"lsp": {
 			"command": "node",
-			"args": ["./dist/cli.js", "mcp"],
+			"args": ["./packages/lsp-tools-mcp/dist/cli.js", "mcp"],
 			"cwd": "."
 		}
</file context>
Suggested change
"args": ["./packages/lsp-tools-mcp/dist/cli.js", "mcp"],
"args": ["./dist/cli.js", "mcp"],

"cwd": "."
}
}
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

## Unreleased

## 0.2.0

- Extracted the LSP runtime and MCP server into [`@code-yeongyu/lsp-tools-mcp`](https://github.com/code-yeongyu/lsp-tools-mcp).
- codex-lsp now consumes that runtime as a git submodule at `packages/lsp-tools-mcp`.
- Kept the Codex-specific PostToolUse hook in this package and routed MCP serving through the upstream CLI.

- Extract LSP runtime to `lsp-tools-mcp` upstream and consume it via git submodule at `packages/lsp-tools-mcp`.
- Renamed the MCP server namespace to `lsp` and exposed shorter tool names such as `lsp.diagnostics`.
- Use portable Codex hook interpolation and add package smoke coverage for hook/MCP entrypoints.
- Spawn language servers without shell mode; Windows `.cmd` and `.bat` shims are routed through `cmd.exe` with explicit arguments.
Expand Down
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

Codex plugin that ports the standalone LSP runtime from [`pi-lsp-client`](https://github.com/code-yeongyu/pi-lsp-client). It gives Codex post-edit diagnostics plus explicit MCP tools for language-aware code work.

## Architecture

The LSP runtime moved to [`lsp-tools-mcp`](https://github.com/code-yeongyu/lsp-tools-mcp) and is consumed here as a git submodule at `packages/lsp-tools-mcp/`.

- `codex-lsp` keeps Codex-specific integration (`hook post-tool-use`, plugin metadata, package wiring).
- `lsp-tools-mcp` owns MCP runtime, LSP manager, and tool implementations.
- `src/cli.ts` routes `mcp` to upstream runtime and keeps `hook post-tool-use` local.

## Behavior

| Case | Result |
Expand Down Expand Up @@ -67,7 +75,7 @@ The plugin ships:
- `hooks/hooks.json` for the `PostToolUse` diagnostics hook.
- `skills/lsp/SKILL.md` with MCP usage guidance.

The runtime has no npm production dependencies, so a clean Codex marketplace copy can run without a follow-up `npm install`.
The runtime depends on `@code-yeongyu/lsp-tools-mcp` via `file:./packages/lsp-tools-mcp`, so marketplace builds must include submodule contents.

The hook command is:

Expand All @@ -78,19 +86,24 @@ node "${PLUGIN_ROOT}/dist/cli.js" hook post-tool-use
The MCP command is:

```bash
node ./dist/cli.js mcp
node ./packages/lsp-tools-mcp/dist/cli.js mcp
```

## Local Development

```bash
git submodule update --init --recursive
npm run bootstrap # installs + builds the lsp-tools-mcp submodule
npm install
npm test
npm run typecheck
npm run check
npm pack --dry-run
```

The `bootstrap` script installs and builds the `lsp-tools-mcp` git submodule so
`@code-yeongyu/lsp-tools-mcp/dist/*.js` is available for the codex-lsp build.

Smoke-test the hook:

```bash
Expand All @@ -112,7 +125,7 @@ codex plugin marketplace add /path/to/codex-plugins
node /path/to/codex-plugins/scripts/install-local.mjs /path/to/codex-plugins
```

If your local Codex build exposes plugin install commands, you can install from the UI or CLI instead. For older local builds, the marketplace installer builds and copies the plugin into `~/.codex/plugins/cache/<marketplace>/codex-lsp/0.1.0` and enables:
If your local Codex build exposes plugin install commands, you can install from the UI or CLI instead. For older local builds, the marketplace installer builds and copies the plugin into `~/.codex/plugins/cache/<marketplace>/codex-lsp/0.2.0` and enables:

```toml
[plugins."codex-lsp@code-yeongyu-codex-plugins"]
Expand Down
4 changes: 2 additions & 2 deletions dist/cli.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cli.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/codex-hook.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/codex-hook.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions dist/lsp/cleanup-errors.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion dist/lsp/cleanup-errors.d.ts.map

This file was deleted.

7 changes: 0 additions & 7 deletions dist/lsp/cleanup-errors.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/lsp/cleanup-errors.js.map

This file was deleted.

14 changes: 0 additions & 14 deletions dist/lsp/client-wrapper.d.ts

This file was deleted.

Loading
Loading