Token导航 LogoToken导航TokenDH.com
Other Agent MCP logo
运维云端未说明官方级别未说明来源级核验

Other Agent MCP

MCP Server

一个提供LangChain.js支持的子代理工具与会话管理的MCP服务器,支持多模型切换和会话上下文保持。

工具数

12

提示词数

0

GitHub Stars

0

资源数

0
会话管理多模型支持TypeScriptClaudeClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

k-l-lambda

提供方

k-l-lambda

最后核验

2026/5/17 20:19

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

其他MCP

一个MCP(模型上下文协议)服务器,为LangChain.js支持的子代理工具提供会话管理。它允许Claude Code(或任何MCP客户端)将任务委托给另一个LLM,同时保持对话上下文。

特性

  • 多提供商支持:OpenAI兼容API(Qwen、DeepSeek、本地模型)和Anthropic兼容API
  • 模型注册表:配置多个模型并在运行时在它们之间切换
  • 会话管理:创建持久对话,以维护多条消息的上下文
  • 会话日志记录:所有对话都会自动保存为markdown文件 sessions/ 目录
  • 内置工具:代理可以读取文件、列出目录、使用grep进行搜索等
  • 简单集成:通过与Claude Code合作 claude mcp add

安装

cd /path/to/other-mcp
npm install
npm run build

配置

环境变量

变量描述默认值
SUBAGENT_PROVIDERopenaianthropicopenai
SUBAGENT_BASE_URLAPI基本URL提供程序默认值
SUBAGENT_API_KEYAPI密钥(必需)-
SUBAGENT_MODEL默认型号IDgpt-4o-mini / claude-sonnet-4-20250514
SUBAGENT_MODELSJSON模型注册表{}

使用.env文件

创建 .env 项目根目录中的文件:

# Provider: 'openai' or 'anthropic'
SUBAGENT_PROVIDER=openai

# API endpoint (for OpenAI-compatible APIs)
SUBAGENT_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1

# Your API key
SUBAGENT_API_KEY=sk-your-api-key-here

# Default model
SUBAGENT_MODEL=qwen-max

# Model registry (JSON format)
# Simple format: model name -> model ID
SUBAGENT_MODELS={"qwen-max":"qwen-max","qwen-turbo":"qwen-turbo","qwen-plus":"qwen-plus"}

模型注册表格式

SUBAGENT_MODELS 环境变量支持两种格式:

简单格式 -只需将名称映射到模型ID(使用默认提供程序设置):

{
  "qwen": "qwen-max",
  "gpt4o": "gpt-4o-mini",
  "turbo": "qwen-turbo"
}

完整配置格式 -覆盖每个模型的提供者/baseUrl:

{
  "qwen": {
    "provider": "openai",
    "modelId": "qwen-max",
    "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
    "apiKey": "sk-qwen-key"
  },
  "claude": {
    "provider": "anthropic",
    "modelId": "claude-3-5-haiku-latest",
    "baseUrl": "https://api.anthropic.com"
  },
  "local": {
    "provider": "openai",
    "modelId": "llama3",
    "baseUrl": "http://localhost:11434/v1",
    "apiKey": "ollama"
  }
}

添加到克劳德代码

基本设置(单一型号)

claude mcp add -s user subagent \
  -e "SUBAGENT_PROVIDER=openai" \
  -e "SUBAGENT_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1" \
  -e "SUBAGENT_API_KEY=your-api-key" \
  -e "SUBAGENT_MODEL=qwen-max" \
  -- node /path/to/other-mcp/dist/index.js

多模型设置

claude mcp add -s user subagent \
  -e "SUBAGENT_PROVIDER=openai" \
  -e "SUBAGENT_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1" \
  -e "SUBAGENT_API_KEY=your-api-key" \
  -e "SUBAGENT_MODEL=qwen-max" \
  -e 'SUBAGENT_MODELS={"qwen-max":"qwen-max","qwen-turbo":"qwen-turbo","qwen-plus":"qwen-plus"}' \
  -- node /path/to/other-mcp/dist/index.js

多提供商设置

对于使用多个提供商(例如,Qwen和当地Ollama):

claude mcp add -s user subagent \
  -e "SUBAGENT_PROVIDER=openai" \
  -e "SUBAGENT_API_KEY=your-qwen-key" \
  -e 'SUBAGENT_MODELS={"qwen":{"provider":"openai","modelId":"qwen-max","baseUrl":"https://dashscope.aliyuncs.com/compatible-mode/v1"},"local":{"provider":"openai","modelId":"llama3","baseUrl":"http://localhost:11434/v1","apiKey":"ollama"}}' \
  -- node /path/to/other-mcp/dist/index.js

MCP工具

run_agent

使用给定的提示符运行LangChain代理(无状态,单圈)。

参数:

参数类型必填说明
promptstringYes代理的任务/提示
system_promptstring代理的系统提示
max_iterationsnumberNo最大工具迭代次数(默认值:10)
modelstring来自SUBAGENT_MODELS的模型名称

例子:

mcp__other__run_agent(prompt="Summarize the key points of quantum computing")
mcp__other__run_agent(prompt="Translate to Chinese", model="qwen-turbo")

list_models

列出SUBAGENT_models中配置的所有可用型号。

输出示例:

## Available Models

| Name | Provider | Model ID | Base URL |
|------|----------|----------|----------|
| _default | openai | qwen-max | https://dashscope.aliyuncs.com/compati... |
| qwen-max | openai | qwen-max | (default) |
| qwen-turbo | openai | qwen-turbo | (default) |
| qwen-plus | openai | qwen-plus | (default) |

Use the `model` parameter in `run_agent` to select a model by name.

创建会话

创建一个新的对话会话,以维护多条消息的上下文。

参数:

参数类型必填说明
modelstring来自SUBAGENT_MODELS的模型名称
system_promptstring会话的系统提示

例子:

mcp__other__create_session(model="gpt-5.1", system_prompt="You are a helpful assistant")
# Returns: session_id

send_message

向现有会话发送消息并获得响应。对话历史被保留。

参数:

参数类型必填说明
session_idstring要向其发送消息的会话ID
messagestring要发送的消息

例子:

mcp__other__send_message(session_id="abc-123", message="Hello, how are you?")
mcp__other__send_message(session_id="abc-123", message="What did I just say?")
# The agent remembers the previous message

list_sessions

列出所有活动的对话会话。

输出示例:

## Active Sessions

| Session ID | Model | Messages | Last Active |
|------------|-------|----------|-------------|
| `d7fbfd49...` | gpt-5.1 | 7 | 2025-12-10T07:59:32.956Z |

Total: 1 session(s)

get_session历史记录

获取特定会话的对话历史记录。

参数:

参数类型必填说明
session_idstring要获取历史记录的会话ID

删除会话

删除对话会话。

参数:

参数类型必填说明
session_idstring要删除的会话ID

代理工具(内置)

代理可以访问以下只读工具来探索文件系统:

read_file

读取文件的内容。

参数:

参数类型必填说明
file_pathstring要读取的文件的路径
max_linesnumber要读取的最大行数

list_directory

列出目录的内容,包括文件大小和修改时间。

参数:

参数类型必填说明
directory_pathstring要列出的目录的路径
show_hiddenboolean是否显示隐藏文件(默认值:false)

全局正则表达式打印

使用正则表达式在文件中搜索模式。

参数:

参数类型必填说明
patternstringYes要搜索的正则表达式模式
pathstring要搜索的文件或目录路径
ignore_caseboolean是否忽略大小写(默认值:false)
max_resultsnumber每个文件的最大结果数

通配符

查找与glob模式匹配的文件。

参数:

参数类型必填说明
patternstringYes要匹配的glob模式(例如,“\*.ts”)
pathstring要搜索的目录

file_info

获取有关文件或目录的详细信息。

参数:

参数类型必填说明
file_pathstring文件或目录的路径

提供商示例

Qwen(阿里云)

SUBAGENT_PROVIDER=openai
SUBAGENT_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
SUBAGENT_API_KEY=sk-your-qwen-key
SUBAGENT_MODEL=qwen-max

深度求索

SUBAGENT_PROVIDER=openai
SUBAGENT_BASE_URL=https://api.deepseek.com/v1
SUBAGENT_API_KEY=sk-your-deepseek-key
SUBAGENT_MODEL=deepseek-chat

开放人工智能

SUBAGENT_PROVIDER=openai
# SUBAGENT_BASE_URL not needed for official OpenAI
SUBAGENT_API_KEY=sk-your-openai-key
SUBAGENT_MODEL=gpt-4o-mini

Anthropic

SUBAGENT_PROVIDER=anthropic
# SUBAGENT_BASE_URL not needed for official Anthropic
SUBAGENT_API_KEY=sk-ant-your-key
SUBAGENT_MODEL=claude-3-5-haiku-latest

Ollama(当地)

SUBAGENT_PROVIDER=openai
SUBAGENT_BASE_URL=http://localhost:11434/v1
SUBAGENT_API_KEY=ollama
SUBAGENT_MODEL=llama3

发展

# Build
npm run build

# Test tools/list
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | node dist/index.js

# Test list_models with config
export SUBAGENT_API_KEY=test
export SUBAGENT_MODELS='{"model1":"gpt-4o","model2":"qwen-max"}'
echo '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"list_models","arguments":{}},"id":2}' | node dist/index.js

许可证

麻省理工学院

目录标签

目录标签

会话管理多模型支持TypeScriptClaude本地部署LangChain集成API兼容文件工具

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

api-key

工具数量(toolCount,工具数)

12

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明api-key部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP