Connect Hermes to the Core's MCP hub and to Supermarket

Hermes runs in CoreDesktop's sandbox, with its own network, so it can't
reach 127.0.0.1:8470. The app now also serves MCP on a Unix socket in its
data folder (/data/mcp.sock), which Hermes reaches with socat. HTTP /mcp
with the bearer token remains for other agents.

hermes/setup.sh asks for the user's own hub token (the Core now issues
per-user tokens), checks it with the hub, and stores it in Hermes' .env.
The hub only speaks SSE, and Hermes' Streamable HTTP attempt can use up
its connect time, so the setup sets transport: sse. It also warns when
Hermes' gateway is still running with the old servers.

Check-ins store the hub's own tool names, without Hermes' mcp__mcphub__
prefix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 12:31:14 -07:00
co-authored by Claude Opus 5.5
parent 1a86589840
commit f3e5b9eff6
12 changed files with 393 additions and 68 deletions
+11 -10
View File
@@ -184,6 +184,7 @@ type coreData struct {
User string
HubURL string
MCPURL string
MCPSocket string
MCPToken string
Last *bridge.Checkin
Prompt string
@@ -198,11 +199,12 @@ func (s *Server) corePage(w http.ResponseWriter, r *http.Request) {
return
}
d := coreData{
Core: s.Core,
MCPURL: "http://127.0.0.1:" + publicPort(s.PublicURL) + "/mcp",
MCPToken: s.MCPToken,
Last: last,
Prompt: bridge.CheckinPrompt,
Core: s.Core,
MCPURL: "http://127.0.0.1:" + publicPort(s.PublicURL) + "/mcp",
MCPToken: s.MCPToken,
MCPSocket: s.MCPSocket,
Last: last,
Prompt: bridge.CheckinPrompt,
}
hub := "https://mcphub.<your Core's domain>/sse?as_user=<your user name>"
if s.Core != nil {
@@ -213,14 +215,13 @@ func (s *Server) corePage(w http.ResponseWriter, r *http.Request) {
d.HermesConfig = `mcp_servers:
mcphub:
url: "` + hub + `"
transport: sse
headers:
Authorization: "Basic ${MCPHUB_AUTH}"
supermarket:
url: "` + d.MCPURL + `"
headers:
Authorization: "Bearer ${SUPERMARKET_MCP_TOKEN}"`
d.HermesEnv = `MCPHUB_AUTH=<base64 of user:password>
SUPERMARKET_MCP_TOKEN=<the token below>`
command: socat
args: ["STDIO", "UNIX-CONNECT:` + d.MCPSocket + `"]`
d.HermesEnv = `MCPHUB_AUTH=<your own hub token from your Core: the part after "Basic ">`
s.render(w, r, "core", page{Title: "Core & Hermes", Nav: "core", Data: d})
}