Langchain MCP C56ede64

MCPAI代理

提供方 montebrown

AI代理 未标注 无需鉴权 社区 / 第三方

LangChain MCP是一个为LangChain应用提供MCP服务器集成的工具,支持工具发现、多模态内容处理和实时监控等功能,适用于AI工作流增强和自动化任务处理。

一句话选型结论

按资料字段整理

Langchain MCP C56ede64 属于AI代理类 MCP 服务器,传输方式未标注,无需鉴权,没有现成安装命令,需按官方文档接入。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类AI代理 传输方式未标注 鉴权无需鉴权 部署方式未标注
GitHub 星标 4 仓库热度,无公开仓库时显示未标注
工具数 3 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

AI代理
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量3暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

适用场景

Elixir本地部署AI工具集成多模态处理自动化工作流实时监控工具发现

安装与配置

未标注 无需鉴权
上游未给出传输方式
  1. 1
    准备运行环境

    按官方文档确认运行环境(常见为 Node.js 或 Python),装好后再执行安装命令。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后客户端会列出约 3 个工具,随便调一个只读工具确认能返回结果。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
给代理接外部能力

让代理在任务中途调用搜索、数据库等真实工具。

多步任务编排

把一串操作拆成步骤,由代理按顺序执行。

自动化重复流程

把固定流程交给代理跑,减少手工操作。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 资料标注 3 个工具,职责相对集中,接入后不容易误操作。
  • 资料标注无需鉴权,装好就能连。

先想清楚的地方

  • 没有现成安装命令,需要按官方文档自己填启动命令和参数。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在AI代理场景里让模型直接调用外部能力的人。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Langchain MCP C56ede64当前 3 未标注 未标注 无 2026-05-17
Filesystem 560c4363 13 未标注 本地部署 无 2026-05-17
Server Everything (everything) 11 stdio · 本地进程 本地部署 有 2026-05-17
Time 7365cb6d 2 SSE · 服务端推送 远程部署 有 2026-05-18
Everything Claude Code 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Openmemory 557e1585 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

AI代理
字段来自项目仓库与公开索引,中文说明由本站标注
提供方montebrown上游标注的维护方 montebrown
分类AI代理本站按上游分类展示
连接方式未标注上游未给出传输方式
鉴权方式无需鉴权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型未标注上游给出的部署形态
最近核验2026-05-17上游最后核验时间

详细介绍

10.9 KB
来自项目仓库与上游目录的原文,未做删改

LangChain MCP

Model Context Protocol (MCP) integration for LangChain Elixir. This library enables LangChain applications to use MCP servers as tool providers, giving instant access to the growing ecosystem of MCP servers.

📚 Full Documentation - Complete API reference and guides available on HexDocs

Features

  • 🔌 Easy Integration - Add MCP tools to your LangChain workflows with minimal code
  • 🛠️ Tool Discovery - Automatically discover and convert MCP tools to LangChain functions
  • 🔄 Fallback Support - Configure fallback MCP clients for resilient tool execution
  • 📦 Multi-modal Content - Full support for text, images, and other content types
  • ⚙️ Configurable - Cache tool discovery, configure timeouts, async execution
  • 🧪 Testing - Mock support for unit tests, live test infrastructure with Docker
  • 📊 Status Monitoring - Real-time monitoring of MCP client health with LiveView support

Installation

Add langchain_mcp to your dependencies in mix.exs:```elixir
def deps do
[
{:langchain, "~> 0.4"},
{:langchain_mcp, "~> 0.1"}
]
end


## Quick Start

### 1. Define an MCP Client```elixir
defmodule MyApp.GitHubMCP do
  use LangChain.MCP.Client,
    name: "MyApp",
    version: "1.0.0",
    protocol_version: "2025-03-26"
end

2. Start the Client in Your Supervision Tree```elixir

defmodule MyApp.Application do
use Application

def start(_type, _args) do
children = [
{MyApp.GitHubMCP,
transport: {:streamable_http, base_url: "http://localhost:5000"}}
]

Supervisor.start_link(children, strategy: :one_for_one)

end
end


### 3. Use MCP Tools in Your Chain```elixir
alias LangChain.Chains.LLMChain
alias LangChain.ChatModels.ChatAnthropic
alias LangChain.Message
alias LangChain.MCP.Adapter

# Create adapter and discover tools
adapter = Adapter.new(client: MyApp.GitHubMCP)
mcp_functions = Adapter.to_functions(adapter)

# Mix with regular functions
all_functions = [
  MyApp.Functions.custom_function()
] ++ mcp_functions

# Use in chain
{:ok, updated_chain} =
  LLMChain.new!(%{llm: ChatAnthropic.new!()})
  |> LLMChain.add_tools(all_functions)
  |> LLMChain.add_message(Message.new_user!("Create a GitHub issue for this bug"))
  |> LLMChain.run(mode: :while_needs_response)

Configuration Options

Adapter Options```elixir

adapter = Adapter.new(
client: MyApp.MCPClient,
# Cache tool discovery (default: true)
cache_tools: true,
# Timeout for tool calls in ms (default: 30_000)
timeout: 30_000,
# Mark tools as async (default: false)
async: false,
# Fallback client if primary fails
fallback_client: MyApp.BackupMCPClient,
# Filter which tools to expose (default: all)
tool_filter: fn tool -> tool["name"] not in ["dangerous_tool"] end
)


### Client Types

The `client` and `fallback_client` options accept multiple reference types:```elixir
# Module name (most common - for supervision tree clients)
adapter = Adapter.new(client: MyApp.MCPClient)

# PID (for dynamically started clients)
{:ok, client_pid} = MyApp.MCPClient.start_link(transport: {:streamable_http, base_url: url})
adapter = Adapter.new(client: client_pid)

# Via tuple (for Registry-based lookups)
adapter = Adapter.new(client: {:via, Registry, {MyApp.Registry, "mcp_client"}})

# Global tuple
adapter = Adapter.new(client: {:global, :my_mcp_client})

Dynamic Clients

For scenarios where you need per-request or per-job MCP clients (e.g., browser automation with Playwright), you can start clients dynamically and pass the PID to the adapter.

Per-Job Pattern```elixir

defmodule MyApp.BrowserJob do
alias LangChain.MCP.Adapter

def run_with_browser(task) do
# Start a dedicated MCP client for this job
{:ok, client_pid} = MyApp.PlaywrightMCP.start_link(
transport: {:streamable_http, base_url: "http://localhost:3000"}
)

# Wait for the client to be ready
:ok = Adapter.wait_for_server_ready(client_pid)

try do
  # Create adapter with the dynamic client
  adapter = Adapter.new(client: client_pid)
  functions = Adapter.to_functions(adapter)

  # Use in your chain
  {:ok, result} = run_chain_with_tools(task, functions)
  result
after
  # Clean up when done
  Supervisor.stop(client_pid)
end

end
end


### With Fallback

Dynamic clients also work with fallback support:```elixir
{:ok, primary_pid} = MyApp.PrimaryMCP.start_link(opts)
{:ok, fallback_pid} = MyApp.BackupMCP.start_link(opts)

adapter = Adapter.new(
  client: primary_pid,
  fallback_client: fallback_pid
)

Selective Tool Discovery```elixir

Get only specific tools

mcp_functions = Adapter.to_functions(adapter, only: ["search", "fetch"])

Exclude certain tools

mcp_functions = Adapter.to_functions(adapter, except: ["admin_tool"])


## Status Monitoring

Monitor the health and status of your MCP clients in real-time.

### Register Clients

Register clients from your Application module:```elixir
defmodule MyApp.Application do
  use Application
  alias LangChain.MCP.StatusMonitor

  def start(_type, _args) do
    children = [
      {MyApp.GitHubMCP, transport: {:streamable_http, base_url: "http://localhost:5000"}}
    ]

    {:ok, _pid} = Supervisor.start_link(children, strategy: :one_for_one)

    # Register clients for status monitoring
    StatusMonitor.register_client_by_name(MyApp.GitHubMCP, :github)

    {:ok, self()}
  end
end

Query Client Status```elixir

alias LangChain.MCP.StatusMonitor

Check if registered

StatusMonitor.registered?(:github)

=> true

Get client status

StatusMonitor.get_client_status(:github)

=> {:ok, %{pid: #PID<0.123.0>}}

Get health summary

StatusMonitor.health_summary()

=> %{

healthy_clients: [:github, :filesystem],

unhealthy_clients: [],

total_clients: 2,

uptime_percentage: 100.0

}

Get dashboard-ready status

StatusMonitor.dashboard_status()


### Phoenix LiveView Integration

A complete LiveView example is included for real-time status monitoring:

- Auto-refreshing dashboard (every 2 seconds)
- Color-coded health indicators
- Uptime percentage tracking
- Detailed client information

See `examples/phoenix_liveview_example.ex` and `STATUS_MONITOR.md` for complete documentation.

## Fallback Support

Similar to LangChain&#x27;s LLM fallbacks, you can configure fallback MCP clients:```elixir
adapter = Adapter.new(
  client: MyApp.PrimaryMCP,
  fallback_client: MyApp.BackupMCP,
  # Optional: modify behavior before fallback
  before_fallback: fn _adapter, tool_name, _args -&gt;
    Logger.warning(&quot;Falling back for tool: #{tool_name}&quot;)
    :continue  # or :skip to skip fallback
  end
)

Testing

Unit Tests with Mocks```elixir

defmodule MyApp.MyAgentTest do
use ExUnit.Case

setup do
# Use Anubis mock transport for testing
{:ok, client} = MyApp.TestMCP.start_link(
transport: {:mock, responses: %{
"list_tools" => %{"tools" => [...]},
"call_tool" => %{"content" => [...]}
}}
)

{:ok, client: client}

end

test "agent uses MCP tools", %{client: _client} do
# Your test here
end
end


### Live Integration Tests

This project includes a built-in Elixir-based MCP test server - no Docker needed!

**Step 1: Start the test server**```bash
mix test_server

This starts an MCP server on http://localhost:5000 with test tools:

  • get_current_time - Get current time in UTC or specified timezone
  • get_timestamp - Get current Unix timestamp
  • add_numbers - Add two numbers together

Step 2: Run integration tests (in a separate terminal)```bash
mix test --include live_call


**Custom port:** If you need to use a different port:```bash
# Terminal 1: Start server on custom port
mix test_server --port 5000

# Terminal 2: Run tests with custom URL
MCP_TEST_URL=http://localhost:5000 mix test --include live_call

Example live test:```elixir
@tag :live_call
test "integrates with real MCP server" do
adapter = Adapter.new(client: MyApp.MCPClient)
functions = Adapter.to_functions(adapter)

assert length(functions) > 0
end


### Using Docker (Optional)

If you prefer Docker or need to test against external MCP servers, you can use docker-compose:```bash
# Start Docker-based MCP servers
docker-compose up -d

# Run tests
mix test --include live_call

Note: Most official MCP servers (like mcp_server_time) use stdio transport and cannot be accessed via HTTP without a wrapper. The built-in Elixir test server is the recommended approach.

Available MCP Servers

Many MCP servers are available via Docker Hub:

  • mcp/time - Time and timezone operations
  • mcp/github - GitHub API integration
  • mcp/postgres - PostgreSQL database access
  • mcp/sqlite - SQLite database operations
  • mcp/puppeteer - Browser automation

See Docker Hub MCP Catalog for more.

Contributing

Quality Checks

Before pushing, ensure code meets quality standards:```bash

Run all checks (same as CI)

mix quality_check

Or run individually:

mix format --check-formatted # Code formatting
mix credo --strict # L linting
mix dialyzer # Type checking
mix test --exclude live_call # Unit tests only


The automated release workflow requires these checks to pass. Use `mix quality_check` locally before committing.

### Testing

- **Unit tests**: Standard ExUnit with mocking via `:mimic`
- **Integration tests**: Tagged `:live_call`, require running test server```bash
# Start test server (Terminal 1)
mix test_server

# Run integration tests (Terminal 2)
mix test --include live_call

Architecture```

┌─────────────────────────┐
│ LangChain.LLMChain │
│ + tools: [Function] │
└────────────┬────────────┘
│
├─── Regular Functions
│
└─── MCP Functions (via Adapter)
│
▼
┌────────────────────┐
│ LangChain.MCP │
│ • Adapter │
│ • SchemaConverter │
│ • ToolExecutor │
│ • ContentMapper │
│ • ErrorHandler │
└────────┬───────────┘
│
▼
┌────────────────────┐
│ Anubis.Client │
│ (GenServer) │
└────────┬───────────┘
│
▼
┌────────────────────┐
│ MCP Server │
│ (Docker/External) │
└────────────────────┘
```

License

Apache 2.0 License. See LICENSE for details.

Links

  • LangChain Elixir
  • Anubis MCP
  • Model Context Protocol
  • MCP Servers Catalog

常见问题

5 问
答案由本站依据条目字段整理,不引用上游原文
Langchain MCP C56ede64 怎么安装?

资料没有给出安装命令,请到官方仓库或文档按说明接入;这类条目多数是生态应用,或尚未发布可安装包。

Langchain MCP C56ede64 怎么在客户端里配置?

它的传输方式未标注,在客户端 MCP 配置里按官方文档填写启动命令和参数,保存后重启客户端生效。

Langchain MCP C56ede64 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Langchain MCP C56ede64 需要 API Key 吗?

资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

Langchain MCP C56ede64 能提供哪些能力?

资料显示约 3 个工具;能力标签包括 工具发现、工作流自动化、实时监控。具体工具清单以官方文档为准。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-05-17。