Harness Engineering 6 months ahead, in a few hours.

Module 06 — MCP (Model Context Protocol)

Updated

In this module

You'll learn how to connect Claude Code to your tools with MCP servers: a database, Jira, GitHub, Figma. You'll add them, share them in a .mcp.json file, handle authentication, secure them and troubleshoot them. You'll also write your own server, and turn Claude Code into a server for other clients.

6.1 — MCP in Claude Code: what an MCP server is for

Without MCP, Claude Code only sees your repository and your terminal. For it to read a ticket or a production error, you have to paste the content into the conversation.

MCP (Model Context Protocol) is an open protocol that connects an AI assistant to external tools. An MCP server is a program that exposes a tool through this protocol. Servers exist for Sentry, Jira, GitHub or your database. Claude Code plays the client role. It connects to the server, discovers what it offers and calls it when your request needs it.

One command adds a server. This one connects Claude Code to Sentry:

claude mcp add --transport http sentry https://mcp.sentry.dev/mcp

You then run claude, type /mcp and sign in to your account in the browser. Now you can ask "What are the most frequent errors since yesterday?". Claude queries Sentry itself.

An MCP server can expose three things:

  • Tools are actions Claude calls, such as creating a ticket or running a SQL query.
  • Resources are data you reference with @, such as a database schema or documentation.
  • Prompts are ready-made commands you run with /.

The protocol is shared by several coding agents. A server written for Claude Code also works with Codex CLI, Cursor or Gemini CLI.

Adding servers costs little context. Tool search is on by default. At startup, Claude Code loads only the tool names and each server's instructions. It loads a tool's full definition when Claude needs it. If a server must stay available on every turn, add "alwaysLoad": true to its configuration.

To find a server, start with the documentation of your tool's vendor. The Anthropic Directory (claude.ai/directory) also lists connectors reviewed by Anthropic. You add the remote ones with claude mcp add. Section 6.11 explains how to write your own server.

Key takeaways

• An MCP server gives Claude Code access to an external tool, such as Sentry, Jira or a database.

• You add a server with claude mcp add, then check its status with /mcp.

• A server exposes tools (actions), resources (data) and prompts (commands).

• Tool search loads definitions on demand, which limits the context used.

In this module

  1. 6.1 — MCP in Claude Code: what an MCP server is for Available
  2. 6.2 — Adding your first MCP server with claude mcp add
  3. 6.3 — MCP transports: HTTP, stdio, SSE and WebSocket
  4. 6.4 — MCP scopes and .mcp.json: local, project, user
  5. 6.5 — MCP authentication: OAuth, headers and headersHelper
  6. 6.6 — MCP server for databases: DBHub in read-only mode
  7. 6.7 — MCP servers for Jira, GitHub, Figma and Linear
  8. 6.8 — MCP resources and prompts
  9. 6.9 — MCP server security: approval, permissions, injection
  10. 6.10 — Troubleshooting an MCP server
  11. 6.11 — Writing your own MCP server
  12. 6.12 — Claude Code as an MCP server

Locked content

Unlock the full course to access this module.

€89 excl. VAT

€106.80 incl. VAT for EU customers · One-time payment

Already purchased? Recover access

Go further