LangChainGo MCP Adapter
A Go adapter that bridges LangChain Go tools with Model Context Protocol (MCP) servers.
What is LangChainGo MCP Adapter?
LangChainGo MCP Adapter is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to go adapter that bridges langchain go tools with model context protocol (mcp) servers.
A Go adapter that bridges LangChain Go tools with Model Context Protocol (MCP) servers.
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A Go adapter that bridges LangChain Go tools with Model Cont
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx langchaingo-mcp-adapterConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use LangChainGo MCP Adapter
The LangChainGo MCP Adapter is a Go library that bridges the LangChain Go agent framework with any MCP-compatible tool server, letting Go developers build AI agents that automatically discover and call tools exposed over the Model Context Protocol. Instead of writing custom API wrappers, you point the adapter at one or more MCP servers and it converts their tool schemas into LangChain Go-compatible tool objects that any supported LLM (Google Gemini, OpenAI, Anthropic Claude) can invoke. This is the idiomatic Go path for adding MCP tool support to agentic workflows without leaving the LangChain Go ecosystem.
Prerequisites
- Go 1.23 or higher installed
- A running MCP server to connect to (e.g., a filesystem or search server)
- An LLM provider API key: GOOGLE_API_KEY, OPENAI_API_KEY, or ANTHROPIC_API_KEY
- The tmc/langchaingo and mark3labs/mcp-go Go modules
Add the adapter to your Go module
Run go get to download the langchaingo-mcp-adapter package and add it to your go.mod.
go get github.com/i2y/langchaingo-mcp-adapterSet your LLM provider API key
Export the environment variable for whichever LLM provider you want your agent to use. The adapter itself is provider-agnostic; the key is consumed by the LangChain Go LLM client.
# Pick one:
export GOOGLE_API_KEY=your-google-api-key
export OPENAI_API_KEY=your-openai-api-key
export ANTHROPIC_API_KEY=your-anthropic-api-keyCreate an MCP client and initialise the adapter
In your Go code, create an mcp-go client pointing at your MCP server, then pass it to the adapter to get a slice of LangChain Go tools.
import (
mcpadapter "github.com/i2y/langchaingo-mcp-adapter"
"github.com/mark3labs/mcp-go/client"
)
mcpClient, _ := client.NewStdioClient("path/to/mcp-server", []string{})
tools, _ := mcpadapter.NewTools(ctx, mcpClient)Wire the tools into a LangChain Go agent
Pass the discovered tools directly to your LangChain Go agent executor alongside your LLM of choice.
import (
"github.com/tmc/langchaingo/agents"
"github.com/tmc/langchaingo/llms/googleai"
)
llm, _ := googleai.New(ctx, googleai.WithDefaultModel("gemini-pro"))
executor, _ := agents.Initialize(llm, tools, agents.ZeroShotReactDescription)
result, _ := chains.Run(ctx, executor, "What files are in the current directory?")Run your agent
Build and run your Go program. The adapter will start the MCP server process, discover its tools, and the agent will call them as needed to answer queries.
go run main.goLangChainGo MCP Adapter Examples
Client configuration
The adapter is a Go library, not a standalone server. Configure it in code by pointing it at an MCP server binary. This example uses the filesystem MCP server.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
"env": {}
}
}
}Prompts to try
After wiring the adapter into a LangChain Go agent, these natural language queries route through MCP tool calls.
- "List all Go source files in the project directory"
- "Search the web for the latest LangChain Go release notes"
- "Read the contents of README.md and summarize the architecture"
- "What tools does this MCP server expose?"Troubleshooting LangChainGo MCP Adapter
Tool discovery returns zero tools
Confirm the MCP server binary starts successfully on its own and prints valid JSON-RPC responses. Run the server directly in a terminal and check for startup errors before connecting the adapter.
API key environment variable not picked up by the LLM client
The adapter does not read API keys itself — they must be set in the environment before you call googleai.New / openai.New. Export the variable in the same shell session where you run 'go run'.
go get fails with 'no required module provides package'
Ensure your go.mod specifies 'go 1.23' or higher and run 'go mod tidy' after adding the dependency to resolve the full dependency graph.
Frequently Asked Questions about LangChainGo MCP Adapter
What is LangChainGo MCP Adapter?
LangChainGo MCP Adapter is a Model Context Protocol (MCP) server that go adapter that bridges langchain go tools with model context protocol (mcp) servers. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install LangChainGo MCP Adapter?
Follow the installation instructions on the LangChainGo MCP Adapter GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with LangChainGo MCP Adapter?
LangChainGo MCP Adapter works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is LangChainGo MCP Adapter free to use?
Yes, LangChainGo MCP Adapter is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
LangChainGo MCP Adapter Alternatives — Similar Developer Tools Servers
Looking for alternatives to LangChainGo MCP Adapter? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up LangChainGo MCP Adapter in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use LangChainGo MCP Adapter?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.