PILOT — Private preview. Progress is saved for this browser session only.
HaiPhai.AI Fluency for Biotech

Hooks, MCP Servers, and Extending Claude Code for Your Team

Lesson 6~20 min1-question check

Module 12 · Lesson 06

Hooks, MCP Servers, and Extending Claude Code for Your Team

Reading time: 20 minutes Track: Claude Fluency for Teams · Developer path


Beyond the default setup

Out of the box, Claude Code is a powerful tool. With hooks and MCP servers, it becomes a customized tool that knows your team's workflows, has access to your team's data sources, and enforces your team's standards automatically.

Hooks

Hooks are shell commands that run automatically in response to Claude Code events. You configure them in .claude/settings.json in your project or in ~/.claude/settings.json for global defaults.

Available hook events:

HookWhen it runs
PreToolUseBefore any tool call (file read, edit, bash command)
PostToolUseAfter any tool call
NotificationWhen Claude wants to notify you of something
StopWhen Claude finishes a response

Common useful hooks:

Auto-format after edits

{
  "hooks": {
    "PostToolUse": [{
      "matcher": "Write",
      "hooks": [{
        "type": "command",
        "command": "prettier --write $CLAUDE_FILE_PATH"
      }]
    }]
  }
}

Run tests after any change

{
  "hooks": {
    "PostToolUse": [{
      "matcher": "Write",
      "hooks": [{
        "type": "command",
        "command": "npm test -- --testPathPattern=$(basename $CLAUDE_FILE_PATH .ts)"
      }]
    }]
  }
}

Lint before finalizing

{
  "hooks": {
    "Stop": [{
      "hooks": [{
        "type": "command",
        "command": "npm run lint"
      }]
    }]
  }
}

The feedback loop hooks create: With auto-format and auto-test hooks, Claude's edits are immediately formatted and tested. Claude sees the test output, can observe failures, and can iterate without you needing to run anything manually. This tight loop dramatically accelerates debugging and refactoring tasks.

MCP Servers

MCP (Model Context Protocol) is an open protocol for connecting Claude to external data sources and tools. An MCP server exposes capabilities — read data, perform actions — that Claude Code can invoke during sessions.

What MCP enables:

  • Claude can query your internal documentation
  • Claude can read your team's Jira/Linear issues
  • Claude can check your deployment status
  • Claude can look up your API specs
  • Claude can query your database (read-only)

How MCP servers work:

You configure MCP servers in .claude/settings.json:

{
  "mcpServers": {
    "internal-docs": {
      "command": "npx",
      "args": ["-y", "@yourcompany/mcp-docs-server"],
      "env": { "DOCS_TOKEN": "..." }
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_TOKEN": "..." }
    }
  }
}

With this configured, you can ask Claude: "What do our internal docs say about the authentication flow?" or "What's the status of PR #1234?" and Claude has access to those systems.

Building a simple MCP server:

If you have internal tooling or documentation, building an MCP server for it is straightforward — it's a small Node.js or Python program that responds to a defined protocol. The MCP SDK handles most of the boilerplate.

Team-level MCP configuration:

Commit your team's MCP server configuration (without secrets) to your repository so every team member gets the same tool access. Store secrets in environment variables or your secrets manager.

Recommended team extension setup

For most engineering teams, this starting configuration delivers significant value:

  1. Auto-format hook: Run your formatter after every file write
  2. Auto-test hook: Run relevant tests after changes
  3. GitHub MCP: Let Claude see PRs, issues, and repo context
  4. Internal docs MCP (if you have a docs system): Let Claude reference your internal documentation

This setup, combined with a good CLAUDE.md, makes Claude Code feel like a team member who has full context on your tooling and standards.

Knowledge check

1 question · select an answer to see if you got it
1.You configure a PostToolUse hook that runs your linter after every file Claude writes. What's the practical effect of this?
Ready to apply this?
Practice with AI →

Bring a real challenge from your work — the AI will help you apply what you just learned.

Module complete
Up next
Chat Workflows for Knowledge Work
Document drafting and editing loops, research synthesis, data analysis with artifacts, meeting prep and async comms, and using Projects for persistent team memory.
Start module →