AGENT SKILL

MCP 服务器接入与使用

mcp-client-tools

连接并使用 MCP(Model Context Protocol)服务器:包括原生内置客户端、mcporter CLI 桥接和 TouchDesigner MCP。

适用职业AI 工程师
License 许可
MIT
最近更新
2026-11-06
Stars
★ 5
Forks
4

01 前言 Front Matter

name
mcp-client-tools
author
Hermes Agent
license
MIT
version
1.0.0
metadata
{ "hermes": { "tags": [ "mcp", "model-context-protocol", "mcporter", "touchdesigner" ], "related_skills": [] } }
platforms
[ "linux", "macos", "windows" ]
description
Connect to and use MCP (Model Context Protocol) servers: native built-in client, mcporter CLI bridge, and TouchDesigner MCP.

02 资源文件 1

03 SKILL.md 正文

MCP Client Tools

Model Context Protocol (MCP) servers expose tools and resources that Hermes can discover and call. There are two ways to use them: the native built-in client (automatic tool discovery) and the mcporter CLI bridge (ad-hoc server interaction).

Native MCP Client

Servers configured in config.yaml are automatically discovered and registered as Hermes tools.

config.yaml

mcp_servers:
  filesystem:
    command: npx
    args: ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"]
    transport: stdio        # or http for remote servers

Discovery

Restart Hermes (or /reset) after adding a server. Tools appear in the toolset.

stdio vs HTTP

  • stdio: local subprocess; tools auto-registered; works offline
  • HTTP: remote endpoint; useful for shared infrastructure; requires network

mcporter CLI Bridge

Ad-hoc interaction with any MCP server without editing config.yaml.

Install

pip install mcporter

List Servers

mcporter list

Call a Tool

mcporter call <server-name> <tool-name> '{"arg": "value"}'

Configure a New Server

mcporter add <name> --command "npx -y @modelcontextprotocol/server-filesystem /tmp"
mcporter add <name> --url "http://localhost:3000/sse" --transport http

Auth

For servers requiring authentication:

mcporter auth <name> --token "<api-key>"
mcporter auth <name> --header "Authorization: Bearer <token>"

Pitfalls

  • mcporter only supports stdio and HTTP transports; SSE is HTTP under the hood
  • Server process must stay alive for the duration of the session
  • JSON args must be single-quoted on shell to prevent interpolation

TouchDesigner MCP

Control a running TouchDesigner instance via the TwoZero MCP server.

Prerequisites

  • TouchDesigner running with TwoZero extension loaded
  • MCP server configured (native or mcporter)

Common Operations

  • Query network structure (/project, /project/geo1)
  • Set parameter values
  • Trigger cook/render
  • Read texture data

Example

# Via native MCP tool (if configured)
touchdesigner_mcp(query="/project/geo1")  # Returns node tree
touchdesigner_mcp(set_param={"path": "/project/geo1/tx", "value": 5.0})

Pitfalls

  • TouchDesigner must be running before the MCP server starts
  • Network paths are case-sensitive
  • Cook operations are blocking — large networks may timeout

04 同仓库更多 Skills