Skip to content

Consume lsp-tools-mcp as submodule#3

Merged
code-yeongyu merged 10 commits into
mainfrom
feat/consume-lsp-tools-mcp-submodule
May 18, 2026
Merged

Consume lsp-tools-mcp as submodule#3
code-yeongyu merged 10 commits into
mainfrom
feat/consume-lsp-tools-mcp-submodule

Conversation

@code-yeongyu
Copy link
Copy Markdown
Owner

@code-yeongyu code-yeongyu commented May 18, 2026

Extract the LSP runtime and stdio MCP server into the new upstream repository at https://github.com/code-yeongyu/lsp-tools-mcp and consume it here as a git submodule pinned to ff2c5145.

Why

The LSP/MCP code is also needed by oh-my-openagent (OpenCode plugin). Maintaining two copies is bad. The upstream now serves as the single source of truth for the LSP runtime and the stdio MCP server.

What stays in codex-lsp

  • src/cli.ts - routes Codex hook post-tool-use locally, forwards mcp to the upstream
  • src/codex-hook.ts - Codex-specific PostToolUse diagnostics hook
  • All Codex plugin metadata (.codex-plugin/, .mcp.json, skills/, hooks/)

What moved to upstream

  • src/mcp.ts and src/tools.ts
  • src/lsp/* (21 files)
  • Tests covering the above (test/mcp.test.ts, test/manager.test.ts, test/process.test.ts, test/directory-diagnostics.test.ts, test/server-definitions.test.ts, test/json-rpc-connection.test.ts, test/config-loader.test.ts, test/utils.test.ts)

Build chain

  • CI checkout now uses submodules: recursive
  • npm install triggers prepare script which installs submodule deps
  • npm run build chains submodule install + build before tsc -p tsconfig.build.json
  • npm test chains submodule install + build before vitest

Verification

Local results:

  • npm run check passes
  • npm test passes (2 files, 7 tests)
  • npm pack --dry-run ships 17 files, 8.5 kB
  • MCP smoke: tools/list returns 7 LSP tools
  • Hook smoke: post-tool-use fixture produces blocking diagnostics output

Version bumped to 0.2.0 (architectural change).


Summary by cubic

Consume the LSP runtime and stdio MCP server from @code-yeongyu/lsp-tools-mcp via a git submodule. Codex routes mcp to the upstream runtime; no behavior changes. CI now explicitly bootstraps the submodule to avoid Windows prepare recursion.

  • Refactors

    • Added packages/lsp-tools-mcp submodule and .gitmodules; CLI and codex-hook import from @code-yeongyu/lsp-tools-mcp.
    • Removed duplicated local LSP/MCP code; kept src/cli.ts, src/codex-hook.ts, and plugin metadata.
    • Updated .mcp.json to run ./packages/lsp-tools-mcp/dist/cli.js mcp.
    • CI/Publish: checkout with submodules: recursive and add a bootstrap step (npm ci && npm run build in packages/lsp-tools-mcp) before root install.
    • Updated README (Architecture) and CHANGELOG 0.2.0.
  • Migration

    • Run git submodule update --init --recursive after checkout (CI already configured).
    • No user-facing changes; existing MCP tools and diagnostics remain the same.

Written for commit 6629268. Summary will update on new commits. Review in cubic

code-yeongyu and others added 9 commits May 18, 2026 11:28
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 136 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".mcp.json">

<violation number="1" location=".mcp.json:5">
P1: Point `.mcp.json` at the packaged root CLI, not the submodule path that is excluded from the published tarball.</violation>
</file>

<file name="package.json">

<violation number="1" location="package.json:49">
P1: This `file:` dependency will be omitted from the published tarball, so installs of the released package will fail resolving `packages/lsp-tools-mcp`.</violation>
</file>

Note: This PR contains a large number of files. cubic only reviews up to 100 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review.
On a pro plan you can use ultrareview for larger PRs.
Re-trigger cubic

Comment thread .mcp.json
"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"],

Comment thread package.json
"check": "tsc --noEmit && biome check src test && npm run build"
},
"dependencies": {
"@code-yeongyu/lsp-tools-mcp": "file:./packages/lsp-tools-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: This file: dependency will be omitted from the published tarball, so installs of the released package will fail resolving packages/lsp-tools-mcp.

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

<comment>This `file:` dependency will be omitted from the published tarball, so installs of the released package will fail resolving `packages/lsp-tools-mcp`.</comment>

<file context>
@@ -36,13 +36,17 @@
+		"check": "tsc --noEmit && biome check src test && npm run build"
+	},
+	"dependencies": {
+		"@code-yeongyu/lsp-tools-mcp": "file:./packages/lsp-tools-mcp"
 	},
 	"devDependencies": {
</file context>

@code-yeongyu code-yeongyu merged commit 16c5ede into main May 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant