经 AI Skill Hub 精选评估,开源MCP代理 获评「强烈推荐」。这款MCP工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.0 分,适合有一定技术背景的用户使用。
开源MCP代理 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
开源MCP代理 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/KochC/opencode-llm-proxy
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"--mcp--": {
"command": "npx",
"args": ["-y", "opencode-llm-proxy"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 开源MCP代理 执行以下任务... Claude: [自动调用 开源MCP代理 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"__mcp__": {
"command": "npx",
"args": ["-y", "opencode-llm-proxy"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
One local endpoint. Every model you have access to. Any API format. Tool calling included.
opencode-llm-proxy is an OpenCode plugin that starts a local HTTP server on http://127.0.0.1:4010. It translates between the API format your tool speaks and whichever LLM provider OpenCode has configured — so you never reconfigure the same models twice.
Your tool (OpenAI / Anthropic / Gemini SDK, coding agent, etc.)
│
▼ http://127.0.0.1:4010
opencode-llm-proxy
│
▼ OpenCode SDK
GitHub Copilot · Anthropic · Gemini · Ollama · OpenRouter · Bedrock · …
Supported API formats — all with streaming and tool/function calling:
| Format | Endpoint |
|---|---|
| OpenAI Chat Completions | POST /v1/chat/completions |
| OpenAI Responses API | POST /v1/responses |
| Anthropic Messages API | POST /v1/messages |
| Google Gemini | POST /v1beta/models/:model:generateContent |
✨ Tool calling works with all four formats — point a coding agent (Claude Code, Cursor, Continue, Cline, your own agent loop, ...) at the proxy and its tools/tool_choice calls are translated through to whatever model OpenCode has configured, with a real tool_calls / tool_use / functionCall response handed back. See Tool calling.
---
npm install opencode-llm-proxy
Add to opencode.json:
{
"plugin": ["opencode-llm-proxy"]
}
Start OpenCode — the proxy starts automatically:
opencode
Send a request:
curl http://127.0.0.1:4010/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "github-copilot/claude-sonnet-4.6",
"messages": [{"role": "user", "content": "Hello!"}]
}'
---
| Variable | Default | Description |
|---|---|---|
OPENCODE_LLM_PROXY_HOST | 127.0.0.1 | Bind address. 0.0.0.0 to expose on LAN or Docker. |
OPENCODE_LLM_PROXY_PORT | 4010 | TCP port. |
OPENCODE_LLM_PROXY_TOKEN | _(unset)_ | Bearer token required on every request. Unset = no auth. |
OPENCODE_LLM_PROXY_CORS_ORIGIN | * | Access-Control-Allow-Origin value for browser clients. |
OPENCODE_LLM_PROXY_TOOL_BRIDGE_POOL_SIZE | 8 | Max concurrent in-flight requests using [tool calling](#tool-calling). |
OPENCODE_LLM_PROXY_HOST=0.0.0.0 \
OPENCODE_LLM_PROXY_TOKEN=my-secret \
opencode
---
import OpenAI from "openai"
const client = new OpenAI({
baseURL: "http://127.0.0.1:4010/v1",
apiKey: "unused",
})
const response = await client.chat.completions.create({
model: "github-copilot/claude-sonnet-4.6",
messages: [{ role: "user", content: "Explain recursion." }],
})
from openai import OpenAI
client = OpenAI(base_url="http://127.0.0.1:4010/v1", api_key="unused")
response = client.chat.completions.create(
model="ollama/qwen2.5-coder",
messages=[{"role": "user", "content": "Write a Python function to reverse a string."}],
)
print(response.choices[0].message.content)
import anthropic
client = anthropic.Anthropic(
base_url="http://127.0.0.1:4010",
api_key="unused",
)
message = client.messages.create(
model="anthropic/claude-3-5-sonnet",
max_tokens=1024,
messages=[{"role": "user", "content": "What is the Pythagorean theorem?"}],
)
print(message.content[0].text)
import Anthropic from "@anthropic-ai/sdk"
const client = new Anthropic({
baseURL: "http://127.0.0.1:4010",
apiKey: "unused",
})
const message = await client.messages.create({
model: "anthropic/claude-opus-4",
max_tokens: 1024,
messages: [{ role: "user", content: "Explain async/await." }],
})
import { GoogleGenerativeAI } from "@google/generative-ai"
const genAI = new GoogleGenerativeAI("unused", {
baseUrl: "http://127.0.0.1:4010",
})
const model = genAI.getGenerativeModel({ model: "google/gemini-2.0-flash" })
const result = await model.generateContent("What is machine learning?")
console.log(result.response.text())
npm install opencode-llm-proxy
Add to your global ~/.config/opencode/opencode.json (works everywhere) or a project-level opencode.json:
{
"plugin": ["opencode-llm-proxy"]
}
In ~/.continue/config.json:
{
"models": [
{
"title": "Claude via OpenCode",
"provider": "openai",
"model": "anthropic/claude-3-5-sonnet",
"apiBase": "http://127.0.0.1:4010/v1",
"apiKey": "unused"
}
]
}
opencode-llm-proxy 是一个专为 OpenCode 环境设计的轻量级 LLM 代理工具。它能够作为一个中间层,帮助开发者更灵活地调用各种大语言模型,实现请求的转发与统一管理,是构建智能化开发工作流的重要组件。
您可以通过 npm 包管理器快速安装此工具。只需在您的项目目录或全局环境中运行 `npm install opencode-llm-proxy` 即可完成安装,确保您的开发环境已配置好 Node.js 运行环境。
安装完成后,请在 `opencode.json` 配置文件中添加 "plugin": ["opencode-llm-proxy"]。启动 OpenCode 后,代理服务会自动运行。您可以使用 curl 命令向 `http://127.0.0.1:4010/v1/chat/completions` 发送请求,通过指定不同的 model 参数(如 Claude 系列)来实现模型调用。
可以通过环境变量对代理进行精细化配置。您可以设置 `OPENCODE_LLM_PROXY_HOST` 来绑定地址(若需在 Docker 或局域网中使用,请设为 `0.0.0.0`),使用 `OPENCODE_LLM_PROXY_PORT` 指定 TCP 端口,并通过 `OPENCODE_LLM_PROXY_TOKEN` 配置 Bearer token 以实现身份验证,同时支持 `OPENCODE_LLM_PROXY_CORS_ORIGIN` 进行跨域控制。
opencode-llm-proxy 完全兼容 OpenAI API 标准。开发者可以无缝使用 OpenAI SDK (JS/TS 或 Python) 进行集成。只需将 `baseURL` 修改为代理服务的地址(如 `http://127.0.0.1:4010/v1`),并将 `apiKey` 设为任意值,即可通过标准化的接口调用各类模型,极大降低了迁移成本。
推荐使用 npm plugin 模式进行集成。您可以将配置写入全局配置文件 `~/.config/opencode/opencode.json` 以实现全局生效,也可以仅在特定项目的 `opencode.json` 中进行配置。这种插件化的工作流确保了代理服务能随 OpenCode 自动启动,实现开箱即用的开发体验。
开源MCP工具,支持多模型调用,开发便捷
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
AI Skill Hub 点评:开源MCP代理 的核心功能完整,质量优秀。对于Claude Desktop / Claude Code 用户来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | opencode-llm-proxy |
| 原始描述 | 开源MCP工具:Local AI gateway for OpenCode with tool/function calling — use any model via Ope。⭐33 · JavaScript |
| Topics | mcpai-gatewayjavascript |
| GitHub | https://github.com/KochC/opencode-llm-proxy |
| License | MIT |
| 语言 | JavaScript |
收录时间:2026-07-05 · 更新时间:2026-07-11 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端