Connect external MCP servers and hooks
Two JSON configuration files let you give the agent tools from external MCP servers, or run your own commands at key moments while it works.
Both files live in %LOCALAPPDATA%\HoudiniAgent\. Developer › Open logs folder in the account menu opens that folder.
Add an external MCP server
- Create
mcp_servers.jsonin that folder. It uses the samemcpServersformat as Claude Desktop and Claude Code:
{"mcpServers": {
"filesystem": {"command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "D:/projects"]},
"remote": {"url": "https://example.com/mcp", "headers": {"Authorization": "Bearer <token>"}},
"off": {"command": "uvx", "args": ["x"], "disabled": true}
}}
- Start a new chat for it to take effect, or click Developer › Reload configuration in the account menu to reconnect MCP servers in the background.
- To check the connections, ask the agent to "list the MCP servers". It reports each server's status, tool count and errors.
Configuration notes:
- Both local command servers (
command,args, optionalenvandcwd) and Streamable HTTP servers (url, optionalheaders) are supported. "disabled": trueswitches a server off for now.- A server's tools appear as
mcp__<server>__<tool>and load only when needed, so they don't sit in the context.
Note
With Ask before each action on, every external MCP tool needs your approval. A tool's arguments and results are sent to the MCP server that provides it.
Run command hooks with hooks.json
Create hooks.json in the same folder. It uses the same format as Claude Code hooks:
{
"hooks": {
"PreToolUse": [{"matcher": "execute_shell|write_file", "command": "python C:/hooks/audit.py", "timeout": 30}],
"PostToolUse": [{"matcher": ".*", "command": "..."}],
"UserPromptSubmit": [{"command": "..."}],
"Stop": [{"command": "..."}],
"SessionStart": [{"command": "..."}]
}
}
Changes to hooks.json are picked up automatically, with no restart.
Supported events
| Event | When | What it can do |
|---|---|---|
PreToolUse |
Before a tool runs | Block the call, or rewrite its arguments (updatedInput) |
PostToolUse |
After a tool runs | Add context to the result |
UserPromptSubmit |
When you send a message | Block the message, or add context |
Stop |
When the agent is about to end its turn | Keep it going, passing the reason as the next message (up to 3 times in a row per turn) |
SessionStart |
When a new chat starts | Runs in the background |
Input and return values
matcheris a regular expression on the tool name; leave it out to match every tool.timeoutdefaults to 30 seconds.- The command receives one line of JSON on standard input:
hook_event_nameplus that event's fields (such astool_name,tool_input,tool_response,prompt,hip). - Exit code
2blocks, and standard error is used as the reason. - With exit code
0, standard output may return JSON:{"decision": "block", "reason": "..."},{"updatedInput": {...}}or{"additionalContext": "..."}. - Any other exit code is only logged, and the agent carries on.
Was this article helpful?