aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsigoden <sigoden@gmail.com>2024-12-13 17:25:58 +0800
committerGitHub <noreply@github.com>2024-12-13 17:25:58 +0800
commit411a9e3da29558c2219a0766c1e6afa0581fa287 (patch)
treef5dd1565d70f1f37887c529498425da81e54f408
parentd692625662c0f7262dab9af049e0adb33ce2e46e (diff)
downloadllm-functions-docker-411a9e3da29558c2219a0766c1e6afa0581fa287.tar.gz
refactor(mcp): change `mcp: <name>` for mcp tool declarations (#151)
-rw-r--r--mcp/bridge/index.js1
-rwxr-xr-xscripts/mcp.sh4
2 files changed, 3 insertions, 2 deletions
diff --git a/mcp/bridge/index.js b/mcp/bridge/index.js
index 59896e3..6a66237 100644
--- a/mcp/bridge/index.js
+++ b/mcp/bridge/index.js
@@ -46,6 +46,7 @@ async function startMcpServer(id, serverConfig) {
name: `${formatToolName(id, name, prefix)}`,
description,
parameters: inputSchema,
+ mcp: id,
},
impl: async args => {
const res = await client.callTool({
diff --git a/scripts/mcp.sh b/scripts/mcp.sh
index fecf52a..eb0bfaa 100755
--- a/scripts/mcp.sh
+++ b/scripts/mcp.sh
@@ -22,7 +22,7 @@ start() {
index_js="$(cygpath -w "$index_js")"
llm_functions_dir="$(cygpath -w "$llm_functions_dir")"
fi
- echo "Run MCP Bridge server"
+ echo "Start MCP Bridge server..."
nohup node "$index_js" "$llm_functions_dir" > "$MCP_DIR/mcp-bridge.log" 2>&1 &
wait-for-server
echo "Merge MCP tools into functions.json"
@@ -114,7 +114,7 @@ recovery-functions() {
# @cmd Generate function declarations for the mcp tools
generate-declarations() {
- curl -sS http://localhost:$MCP_BRIDGE_PORT/tools | jq '.[] |= . + {mcp: true}'
+ curl -sS http://localhost:$MCP_BRIDGE_PORT/tools
}
# @cmd Wait for the mcp bridge server to ready