@mintmcp/claude-agent-hook
v0.0.1
Published
MintMCP hook integration for Claude Agent SDK
Keywords
Readme
@mintmcp/claude-agent-hook
MintMCP hook integration for the Claude Agent SDK. Forwards agent hook events to MintMCP for logging, rule enforcement, and alerting.
Installation
npm install @mintmcp/claude-agent-hookUsage
Get your organization key from the MintMCP dashboard at https://app.mintmcp.com/monitor/setup
Complete hooks config
Use createMintMCPHooks when MintMCP is the only hook provider:
import { query } from "@anthropic-ai/claude-agent-sdk";
import { createMintMCPHooks } from "@mintmcp/claude-agent-hook";
const result = await query({
prompt: "...",
options: {
hooks: createMintMCPHooks({
orgKey: "your-org-key",
}),
},
});Composing with other hooks
Use createMintMCPHook to get a single hook callback that can be composed with other hooks:
import { query } from "@anthropic-ai/claude-agent-sdk";
import { createMintMCPHook } from "@mintmcp/claude-agent-hook";
const mintMCPHook = createMintMCPHook({
orgKey: "your-org-key",
});
const result = await query({
prompt: "...",
options: {
hooks: {
PreToolUse: [{ hooks: [mintMCPHook, someOtherHook] }],
PostToolUse: [{ hooks: [mintMCPHook] }],
UserPromptSubmit: [{ hooks: [mintMCPHook] }],
},
},
});API
createMintMCPHooks(options)
Returns a complete hooks configuration object for use with the Claude Agent SDK.
createMintMCPHook(options)
Returns a single HookCallback function for composing with other hooks.
Options
| Option | Type | Required | Description |
|--------|------|----------|-------------|
| orgKey | string | Yes | Your MintMCP organization key |
| user | string | No | Username shown in logs (defaults to $USER) |
Supported Hook Events
PreToolUse- Called before tool executionPostToolUse- Called after tool executionUserPromptSubmit- Called when a user prompt is submitted
