feat: support MCP bridge (#140)

This commit is contained in:
sigoden
2024-12-11 20:46:17 +08:00
committed by GitHub
parent c58abcbaf8
commit 20d1ec47f9
7 changed files with 549 additions and 5 deletions
+42
View File
@@ -0,0 +1,42 @@
# MCP-Bridge
Let MCP tools be used by LLM functions.
## Get Started
1. Create a `mpc.json` at `<llm-functions-dir>`.
```json
{
"mcpServers": {
"sqlite": {
"command": "uvx",
"args": [
"mcp-server-sqlite",
"--db-path",
"/tmp/foo.db"
]
},
"github": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
}
}
}
}
```
> MCP-Bridge will launch the server and register all the tools listed by the server. The tool identifier will be `server_toolname` to avoid clashes.
2. Run the bridge server, build mcp tool binaries, update functions.json, all with:
```
argc mcp start
```
> Run `argc mcp stop` to stop the bridge server, recover functions.json