How to Use the GitHub MCP in LangChain
Run multi-step LangChain chains that inspect repositories, open issues, and manage pull requests directly within your agent pipelines.
Works with every AI agent you already use
…and any MCP-compatible client
Connect GitHub MCP to LangChain
Create your Vinkius account to connect GitHub to LangChain and route execution through our secure gateway. The platform manages server hosting, runtime updates, and security layers. Configuration requires no manual server provisioning.
Chain GitHub MCP Server tools into autonomous workflows
Your LangChain agent can now run sequential operations across your codebases using this MCP connection, starting with `list_my_repositories` to fetch your projects. The agent pulls a list of active repositories and immediately scans for open tickets. It feeds these issues directly into the next step of your chain to prioritize work. This setup lets you build self-correcting pipelines. When a test fails in your CI, the agent runs `get_file_content` to inspect the broken code, then uses `create_new_issue` to document the exact line that failed. You get a fully traced execution path in LangSmith showing every tool call.
Trace LangChain tool execution with pinpoint accuracy
LangChain pipelines thrive on observability, and this integration exposes every raw API payload when calling `list_pull_requests` to audit open code reviews. LangSmith tracks the exact latency and token cost of that specific call. You see exactly what repository data went in and what came out. If an agent gets stuck trying to locate a specific branch using `list_repo_branches`, you do not have to guess what went wrong. The trace logs show the exact parameters passed to the GitHub API. This visibility makes debugging complex multi-agent reasoning chains straightforward with this MCP integration.
Automate repository audits using composable chains
Combine different data sources into a single, logical flow by pulling organization data with `list_my_organizations` first. The agent can then search across projects with `search_repositories` and list active code snippets with `list_my_gists`. It connects these steps without manual glue code. You control the decision-making loop. The agent evaluates the output of `get_repository_details` to decide if a repo needs maintenance. If it does, the chain automatically triggers the next tool to flag the issue, keeping your codebases clean.
Set up GitHub MCP in LangChain
Prerequisites
- Python 3.10+ installed
-
langchain-mcp-adapters+langgraphpackages - Active Vinkius subscription with a valid endpoint token
- 1
Install dependencies
Run
pip install langchain-mcp-adapters langgraph langchain-openai. The MCP adapters package converts MCP tools into native LangChainBaseToolobjects. - 2
Connect via HTTP transport
Use
MultiServerMCPClientwith"transport": "http"pointing to your Vinkius endpoint. Replace[YOUR_TOKEN_HERE]with your token from cloud.vinkius.com. - 3
Create a ReAct agent
Pass the discovered tools to
create_react_agent()from LangGraph. The agent automatically routes GitHub tool calls through the MCP protocol. - 4
Run with any LLM
Swap
ChatOpenAIforChatAnthropic,ChatGoogleGenerativeAI, or any LangChain-compatible model. The MCP tools work identically across all providers.
from langchain_mcp_adapters.client import MultiServerMCPClient
from langgraph.prebuilt import create_react_agent
from langchain_openai import ChatOpenAI
async with MultiServerMCPClient({
"github-extended-mcp": {
"transport": "http",
"url": "https://edge.vinkius.com/[YOUR_TOKEN_HERE]/mcp",
}
}) as client:
tools = client.get_tools()
agent = create_react_agent(
ChatOpenAI(model="gpt-4o"),
tools,
)
result = await agent.ainvoke({
"messages": "List recent GitHub transactions"
})
print(result["messages"][-1].content) Independent Platform Disclaimer: Vinkius is an independent platform and is not affiliated with, endorsed by, sponsored by, verified by, or otherwise authorized by GitHub. All third-party trademarks, logos, and brand names are the property of their respective owners. Their use on this website is strictly for informational purposes to identify service compatibility and interoperability.
Why Choose Vinkius
Vinkius connects your tools to AI with real-time monitoring and automatic cost savings — all from one dashboard.
Real-time monitoring
Live
visibility into every interaction
Connect your favorite tools to your AI and see exactly what's happening — every request, every response, in real time.
Built-in savings
60%
lower AI costs
Vinkius compresses data between your apps and your AI automatically. Lower bills every month — no configuration required.
Single dashboard
One
place for every integration
Every tool your AI connects to, managed from a single screen. One account, complete control.
Common questions about GitHub MCP in LangChain
Use it with your favorite AI tools
Connect this server to Cursor, Claude, VS Code, and more.
Start using the GitHub MCP today
We host it, we monitor it, we maintain it. You just paste one token.