
codenjoyme/copilot-mcp-langchain
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
This project demonstrates how to extend GitHub Copilot capabilities using Python, Langchain, and the Model Context Protocol (MCP), allowing for more deterministic and powerful interactions with the...
Обзор
This project demonstrates how to extend GitHub Copilot capabilities using Python, Langchain, 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 Langchain. 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.
README
Показан фрагмент оригинального README. Открыть оригинал.
Extending GitHub Copilot with Python and Langchain via MCP
This project demonstrates how to extend GitHub Copilot capabilities using Python, Langchain, and the Model Context Protocol (MCP), allowing for more deterministic and powerful interactions with the LLM.
Project Overview
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 Langchain.
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.
The Problem
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.
The Solution
This project demonstrates a solution through:
Pythonscripts installed on the local machine.- Custom
MCPserver configuration through.vscode/mcp.json - Custom tools defined in the
mcp_server/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.
Data Security
⚠️ Important: Please review the Security Disclaimer before using this tool in production environments.
This document outlines potential data leak scenarios and provides guidance on risk mitigation when working with this tool.
Key Components
-
Simple Examples (
mcp_server/simple/): Demonstrates integration with different LLM providers and key LangChain conceptsquery_openai.py- OpenAI integrationquery_azure.py- Azure OpenAI integrationprompt_template.py- Prompt template management and usagerag.py- Retrieval-Augmented Generation (RAG) with vector searchagent.py- AI Agent with specialized tools (character counting, MD5 hashing, regex matching)structured_output.py- Structured data extraction in multiple formats (JSON, YAML, Markdown)chain_of_thought.py- Step-by-step problem solving with transparent reasoningcolor.py- Helper module for colored terminal output
-
MCP Implementation:
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →