From c1f21461863f06c93147c8dec50852b1eb2ee8b1 Mon Sep 17 00:00:00 2001 From: beabigegg Date: Thu, 8 Jan 2026 22:52:33 +0800 Subject: [PATCH] chore: add MCP LSP proxy configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add .mcp.json for vscode-lsp MCP server - Add mcp-lsp-proxy.sh wrapper script 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .mcp.json | 8 ++++++++ mcp-lsp-proxy.sh | 25 +++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .mcp.json create mode 100755 mcp-lsp-proxy.sh diff --git a/.mcp.json b/.mcp.json new file mode 100644 index 0000000..da9cbda --- /dev/null +++ b/.mcp.json @@ -0,0 +1,8 @@ +{ + "mcpServers": { + "vscode-lsp": { + "type": "stdio", + "command": "./mcp-lsp-proxy.sh" + } + } +} \ No newline at end of file diff --git a/mcp-lsp-proxy.sh b/mcp-lsp-proxy.sh new file mode 100755 index 0000000..20b0ba2 --- /dev/null +++ b/mcp-lsp-proxy.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Add local bin to PATH +export PATH="$HOME/.local/bin:$PATH" + +# Check if mcp-proxy is installed, if not install it +if ! command -v mcp-proxy &> /dev/null; then + echo "mcp-proxy not found, installing..." >&2 + "$HOME/.local/bin/uv" tool install mcp-proxy || uv tool install mcp-proxy +fi + +# Get the port from environment variable, default to 37140 if not set +if [ ! -z "${LSP_MCP_PORT}" ]; then + PORT="${LSP_MCP_PORT}" +else + # Look for a file in the current dir called .lsp_mcp.port and get the port from there + if [ -f .lsp_mcp.port ]; then + PORT=$(cat .lsp_mcp.port) + else + PORT=37140 + fi +fi + +# Call mcp-proxy to connect to the LSP server +exec mcp-proxy --transport streamablehttp "http://localhost:${PORT}"