Skip to content

Fix Copilot Chat startup error: add MCP server, fix plugin name mismatch, unblock .vscode/mcp.json#12

Merged
lllyfeng merged 3 commits into
mainfrom
copilot/fix-copilot-chat-error
Apr 10, 2026
Merged

Fix Copilot Chat startup error: add MCP server, fix plugin name mismatch, unblock .vscode/mcp.json#12
lllyfeng merged 3 commits into
mainfrom
copilot/fix-copilot-chat-error

Conversation

Copilot AI commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Copilot Chat errored on every VS Code startup because .vscode/ was fully gitignored (no shared MCP config) and the built-in validator plugin was registered under the wrong name, causing silent compilation failures.

Changes

  • .vscode/mcp.json — Added workspace MCP server config using the correct VS Code key ("servers", not "mcpServers"). Uses python -m yang_compiler.mcp_server with PYTHONPATH so no package install is required beyond mcp>=1.23.0.

  • .gitignore — Changed .vscode/ blanket-ignore to .vscode/* + !.vscode/mcp.json so shared tooling config is tracked while user-specific files remain ignored.

  • python/src/yang_compiler/mcp_server.py — New MCP server exposing three tools to Copilot Chat: validate_yang, generate_tree, compile_yang. Starts cleanly without a built JAR; tools return a helpful message instead of crashing.

  • python/pyproject.toml — Added mcp optional extra (mcp>=1.23.0) and yang-compiler-mcp CLI entry point.

  • src/main/resources/plugins.json — Renamed plugin schema_validatorvalidator_plugin to match every script, doc, and Python caller. Previously caused ./yangc compile to silently skip validation with a "Cannot find a plugin" warning.

Original prompt

copilot chat坏了,每次启动都显示出错了。请告诉我原因

Copilot AI changed the title [WIP] Fix error on startup for Copilot Chat Fix Copilot Chat startup error: add MCP server, fix plugin name mismatch, unblock .vscode/mcp.json Apr 9, 2026
Copilot AI requested a review from lllyfeng April 9, 2026 23:09
@lllyfeng lllyfeng marked this pull request as ready for review April 10, 2026 06:00
@lllyfeng lllyfeng merged commit f9561e5 into main Apr 10, 2026
3 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.

2 participants