---
title: MCP & hooks
description: Connect MCP servers and run your own scripts at session lifecycle boundaries.
status: draft
sidebar:
  order: 4
---

## MCP servers

Nori is an MCP client. Configure servers under `[mcp_servers.<name>]` in
`config.toml`; manage connections in the TUI with `/mcp`.

```toml
[mcp_servers.github]
command = "npx"
args = ["-y", "@modelcontextprotocol/server-github"]

[mcp_servers.internal]
url = "https://mcp.example.com"
bearer_token_env_var = "INTERNAL_MCP_TOKEN"
```

Both stdio and streamable-HTTP transports are supported, with per-server
`enabled`, startup/tool timeouts, and `enabled_tools`/`disabled_tools`
filters.

## Hooks

`[hooks]` runs your scripts at eight lifecycle boundaries — `session_start`,
`session_end`, `pre_user_prompt`, `post_user_prompt`, `pre_tool_call`,
`post_tool_call`, `pre_agent_response`, `post_agent_response` — each with an
`async_`-prefixed fire-and-forget variant.

```toml
[hooks]
session_start = ["~/.nori/hooks/announce.sh"]
async_post_tool_call = ["~/.nori/hooks/log-tools.py"]
```

The interpreter follows the extension (`.sh` → bash, `.py` → python3, `.js` →
node); `~` expands; synchronous hooks time out after `script_timeout`
(default 30 s).
