AGENT SKILL

mcp-server-install

Install local MCP servers into Hermes from source.

License 许可
MIT
最近更新
2026-08-16
Stars
★ 0
Forks
0

01 前言 Front Matter

name
mcp-server-install
author
Hermes Agent
license
MIT
version
1.0.0
category
autonomous-ai-agents
metadata
{ "hermes": { "tags": [ "hermes", "mcp", "installation", "devops", "configuration" ], "related_skills": [ "hermes-agent", "hermes-mcp-oauth-servers", "remote-mcp-oauth-setup" ] } }
description
Install local MCP servers into Hermes from source.

02 资源文件 2

03 SKILL.md 正文

MCP Server Install (local / from source)

Install a local MCP server (community repo, self-built, or browser-automation server) into Hermes so its tools appear as mcp_<server>_<tool> in every session.

When to Use

  • User asks to install an MCP server from a GitHub repo URL
  • A local/self-hosted MCP server needs registering into Hermes (stdio transport)
  • Re-verifying or debugging an existing MCP registration

Not this skill: OAuth/remote HTTP servers → hermes-mcp-oauth-servers / remote-mcp-oauth-setup. Installing SKILLS from GitHub → third-party-skill-install. This skill is for MCP servers built locally.

Decision: npx vs from-source

  • Published npm package with a clean wrapper (npx pkg@latest): fine for interactive CLIs (Claude Code, Codex).
  • Prefer build from source when the package is new/unstable, when Hermes is the consumer (stdio over a stable absolute path beats npx cache/PATH surprises), or when you want the config to reference a real file.
  • Build into ~/Projects/<name> — NOT /tmp: the config stores the absolute path; /tmp gets cleaned.

Workflow

  1. Inspect the repo first — README + package.json: confirm it's an MCP server, note runtime (node/python), transport (stdio vs Streamable-HTTP), and auth flow (browser login? API key?).
  2. Clone + build (node example):
    cd ~/Projects && git clone --depth 1 <repo> && cd <name>
    export NODE_OPTIONS=--dns-result-order=ipv4first   # npm on node 22+ needs it on this host
    npm install && npm run build
    node dist/index.js   # boots? shows banner/logs? good.
    
    Prereqs: node --version; mcp python package (python3 -c "import mcp" — required by Hermes' native MCP client); Chrome if the server drives a browser.
  3. Register with hermes mcp add — NEVER hermes config set for args (see Pitfalls):
    printf 'Y\n' | hermes mcp add <name> --connect-timeout 90 --command node --args /abs/path/to/dist/index.js
    
    • --args MUST be the last option. Hermes-side flags (--connect-timeout, --env, --auth) go BEFORE --command/--args or they leak into the server's argv.
    • The command is interactive ("Enable all N tools? [Y/n/select]") — pipe Y\n to auto-accept all tools.
  4. Verify:
    hermes mcp test <name>   # live handshake + tool list (list_tools)
    # readback the config entry — clean shape is args as a LIST:
    python3 -c "import yaml,json; print(json.dumps(yaml.safe_load(open('/home/cybertron/.hermes/config.yaml'))['mcp_servers']['<name>'], indent=2))"
    
    Clean shape: command, args (list!), connect_timeout, enabled: true. If args is a string → malformed (see Pitfalls).
  5. Restart Hermes — MCP tools load at startup only; they appear as mcp_<server>_<tool> in NEW sessions. No hot-reload.
  6. Auth (browser-driven servers) — first run calls setup_auth: opens a VISIBLE Chrome window; the USER logs in (never touch their credentials); cookies persist in the server's profile dir; subsequent runs go headless. Warn: many such servers store cookies plaintext on disk.

Pitfalls

Pitfall Fix
hermes config set mcp_servers.X.args '["..."]' Stores args as a YAML string, not a list → server never launches. Remove the entry (hermes mcp remove) and use hermes mcp add
Hermes-side flag placed AFTER --args Leaks into the server's argv (e.g. node dist/index.js --connect-timeout 90). All Hermes config flags must precede --args
Interactive "Enable all N tools?" prompt hangs Pipe printf 'Y\n'
npm audit fix on a fresh MCP-SDK clone Bumps @modelcontextprotocol/sdk and can break the TypeScript build (e.g. resourceTemplates no longer in server options type, TS2353). Restore the locked tree: git checkout -- package.json package-lock.json && npm install && npm run build. Transitive vulns in HTTP-only deps (path-to-regexp, qs) are not reachable over stdio — acceptable; document it
Unknown flags in server argv Some servers ignore them, but keep the config clean anyway
Cookies plaintext on disk Server's own Chrome profile dir (e.g. ~/.local/share/<pkg>/chrome_profile/) — fine for personal use; warn before using a sensitive work account

Verification checklist

  • [ ] hermes mcp test <name> exits 0 and lists tools
  • [ ] config.yaml entry has args as a list and enabled: true
  • [ ] server binary boots standalone
  • [ ] user informed about: restart required, auth step (if any), plaintext-cookie caveat

References\n\n- references/notebooklm-mcp.md — notebooklm-mcp (Google NotebookLM via Patchright Chrome): install record, tool inventory, auth profile path\n- references/pinterest-auth.md — Pinterest MCP server authentication steps and notes\n\n## Related\n\n- hermes-agent (bundled) — references/native-mcp.md has the config schema and lifecycle; this skill adds the from-source install workflow and CLI pitfalls\n- hermes-mcp-oauth-servers, remote-mcp-oauth-setup — remote/OAuth servers (separate class)

04 同仓库更多 Skills