This project demonstrates how to extend GitHub Copilot capabilities using JavaScript/Node.js and the Model Context Protocol (MCP), allowing for more deterministic and powerful interactions with the LLM.
As a GitHub Copilot trainer, I've observed its impressive evolution. However, I've always wanted to access GitHub Copilot's internals to build more complex transformation chains. This project shows how to achieve that goal by leveraging MCP (Model Context Protocol) and custom MCP tools.
While GitHub Copilot repository custom instructions feature improved customization options, the introduction of the MCP protocol opened new possibilities for extending Copilot's functionality through custom MCP servers.
Instruction files are not always deterministic - they need to be fine-tuned when new LLM versions are released to reduce hallucinations. LLMs often struggle with precise text manipulations, sometimes creatively reinterpreting tasks and adding unwanted artifacts. What we need is a way to inject deterministic logic into our instructions.
This project demonstrates a solution through:
JavaScript/Node.jsscripts installed on the local machine.- Custom
MCPserver configuration through.vscode/mcp.json - Custom tools defined in the
tools/directory
With this setup, GitHub Copilot gains access to new, well-documented tools that it can see as part of your project. When you ask Copilot to "create a tool that does X", it can generate a solution very close to what you need. You simply accept its changes and restart MCP to get a new deterministic tool for your specific logic.
This document outlines potential data leak scenarios and provides guidance on risk mitigation when working with this tool.
🚧 Status: Baby Step 1 - Basic MCP Server ✅
# 1. Clone or download the project
# 2. Navigate to .mcp-javascript folder
cd .mcp-javascript
# 3. Install dependencies
npm install
# 4. Copy environment template (optional for now)
copy build\config\.env .env
# 5. Test the server
npm start
# Press Ctrl+C to stop
# 6. Check logs
Get-Content logs\mcp_server.log -Tail 20- Copy config to workspace root:
copy build\config\.vscode\mcp.json ..\..\.vscode\mcp.json
- Restart VS Code
- The MCP server should appear in the MCP servers list
- Copy
build/config/.cursor/mcp.jsoncontent to Cursor Settings - Go to Cursor Settings → Features → Enable MCP
- Paste the configuration
- Restart Cursor
Note: The configs already include GitHub Copilot MCP server integration.
✅ Basic MCP Server - Responds to MCP protocol
✅ Logging System - All events logged to logs/mcp_server.log
✅ Configuration Templates - Ready for VS Code and Cursor
⏳ Tools - Coming in next steps
⏳ Pipeline Engine - Coming soon
⏳ CLI Runner - Coming soon
npm startYou should see nothing in the console (stdio is used for MCP protocol). Press Ctrl+C to stop the server.
Then check the log file:
Get-Content logs\mcp_server.log -Tail 20You should see:
2025-11-14 XX:XX:XX - INFO - Logging initialized for mcp_server
2025-11-14 XX:XX:XX - INFO - Starting MCP JavaScript Server
2025-11-14 XX:XX:XX - INFO - Node.js executable: C:\Java\nodejs\node.exe
2025-11-14 XX:XX:XX - INFO - Node.js version: v20.15.0
2025-11-14 XX:XX:XX - INFO - Current directory: C:\Java\CopipotTraining\mcpyrex\.mcp-javascript
2025-11-14 XX:XX:XX - INFO - All modules imported successfully
2025-11-14 XX:XX:XX - INFO - Starting MCP server with stdio transport
2025-11-14 XX:XX:XX - INFO - Registering MCP handlers...
2025-11-14 XX:XX:XX - INFO - MCP server configured successfully
2025-11-14 XX:XX:XX - INFO - Phase 1: Basic Infrastructure - COMPLETE ✅
2025-11-14 XX:XX:XX - INFO - Phase 2: MCP Server Core - COMPLETE ✅
2025-11-14 XX:XX:XX - INFO - Starting MCP server...
2025-11-14 XX:XX:XX - INFO - MCP server started successfully and listening on stdio
2025-11-14 XX:XX:XX - INFO - Server is ready to accept requests
✅ If you see these logs - Test 1 PASSED!
The run.js script provides a standalone tool runner for testing tools without MCP overhead (like Python's run.py and .NET's Run.cs).
# Show usage help
node run.js
# List available tools
node run.js list
# Run a specific tool
node run.js run lng_count_words '{"input_text":"Hello world"}'
# Get tool schema
node run.js schema lng_count_words
# Run tools in batch
node run.js batch lng_count_words '{"input_text":"test"}' lng_math_calculator '{"expression":"2+2"}'
# Start in daemon mode (keeps process alive)
node run.js run --daemon lng_webhook_server '{"operation":"start", "name":"test"}'
# Batch daemon mode
node run.js batch --daemon lng_webhook_server '{"operation":"start"}' lng_webhook_server '{"operation":"list"}'
# Install dependencies for specific tools
node run.js install_dependencies lng_email_client
# Analyze npm packages
node run.js analyze_libs express react axiosStatus:
- ✅ CLI runner fully implemented
- ✅ Structure matches Python/C# versions exactly
- ⏳ Tool Registry and tools implementation in progress
✅ If you see proper usage output - Test 2 PASSED!
See "MCP Configuration" section above.
Once configured in VS Code/Cursor, the server should:
- Start automatically when you open the IDE
- Show up in MCP servers list
- Respond to
list_toolsrequest (returns empty list for now) - Not crash when called
Check logs after IDE starts:
Get-Content logs\mcp_server.log -Tail 30Look for:
INFO - Received list_tools request
✅ If you see this - Test 3 PASSED! Server is working with MCP protocol!
To control whether MCP (Model Context Protocol) is enabled or disabled, modify ${workspaceFolder}/.vscode/settings.json:
{
"chat.mcp.enabled": true,
"github.copilot.chat.codeGeneration.useInstructionFiles": false
}{
"chat.mcp.enabled": false,
"github.copilot.chat.codeGeneration.useInstructionFiles": true
}{
"servers": {
"mcpyrex-javascript":{
"type": "stdio",
"command": "node",
"args": ["${workspaceFolder}\\.mcp-javascript\\server.js"]
},
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/"
}
}
}API keys and other credentials should be stored in a .env file (template in build/config/.env).
🚧 Tools will be implemented in upcoming baby steps:
lng_batch_run- Advanced pipeline executionlng_count_words- Word counting demonstrationlng_get_tools_info- Tools information retrieval- And more in
tools/directory
🚧 CLI runner (run.js) will be implemented in the next baby step:
node run.js list
node run.js schema lng_count_words
node run.js run lng_count_words '{"input_text":"Hello world"}'After Baby Step 1 works:
- Implement
run.jsfor CLI testing - Add first simple tool (
lng_count_words) - Add ToolRegistry
- Implement StateManager
- Add Pipeline engine
- Port all tools from Python/C# versions
Server won't start?
- Check Node.js version:
node --version(need 18+) - Check logs:
Get-Content logs\mcp_server.log - Try:
npm installagain
No logs directory?
- It will be created automatically on first run
VS Code/Cursor doesn't see the server?
- Check the path in
mcp.jsonuses${workspaceFolder} - Restart VS Code/Cursor after changing config
- Check VS Code Developer Tools console for MCP errors
This project is a JavaScript/Node.js port based on:
- Python version: https://github.com/codenjoyme/mcpyrex-python
- .NET version: https://github.com/codenjoyme/mcpyrex-dotnet
Blog post: Как расширить GithubCopilot с помощью Python и Langchain через MCP