# MCP Tool Hook

> A hook that calls a tool on an MCP server.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** type: mcp_tool

## Think of it like

It is like you ask a helper you already know. You give them one more job.

## Definition

An MCP tool hook is a hook whose type is mcp_tool, so it calls a tool on an MCP server you have set up. You name the server, the tool and its input. The input can pull values from the event, such as ${tool_input.file_path}. The tool's text reply is read the same way as a command hook's output.

## Example

Jack already has an MCP server that scans for secrets. An MCP tool hook calls it on each file Claude writes, with no extra script.

## Example code

```json
{
  "type": "mcp_tool",
  "server": "security",
  "tool": "scan_file",
  "input": { "path": "${tool_input.file_path}" }
}
```

Scan each file Claude writes.

## Why it matters

It reuses a tool you trust instead of writing a new script around it.

## Common mistake

Naming a plugin's server by its short name. A server from a plugin has a longer name that starts with plugin.

## Three principles

- **Calls an MCP tool.** Server and tool.
- **Fills in values.** From the event.
- **Reply as output.** Like a command.

## Related terms

- [MCP Tool](https://learn.benibix.com/term/ai/mcp-tool)
- [MCP Server](https://learn.benibix.com/term/ai/mcp-server)
- [Command Hook](https://learn.benibix.com/term/ai/command-hook)

---

Source: https://learn.benibix.com/term/ai/mcp-tool-hook
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
