<!-- description: MCP (Model Context Protocol) is an open protocol by Anthropic that standardizes how AI agents connect to external tools, data sources, and services using a client-server architecture. -->

# MCP (Model Context Protocol)

**MCP (Model Context Protocol)** is an open protocol developed by Anthropic that standardizes how AI agents connect to external tools, data sources, and services. MCP defines a common language that [MCP clients](mcp-client) (like [Claude Code](claude-code)) use to communicate with [MCP servers](mcp-server) (like AgentRQ) — enabling a rich ecosystem of interoperable agent capabilities.

## Why MCP Exists

Before MCP, every AI tool had to build custom integrations for every service it wanted to connect to. This created a fragmented ecosystem where each LLM provider and each tool had incompatible APIs.

MCP solves this with a standard protocol. A server built to the MCP spec works with any MCP-compatible client, and a client built to the MCP spec can use any MCP server — without custom code.

## MCP Architecture

```
AI Agent (MCP Client)
        │
        │  MCP Protocol (JSON-RPC over stdio/SSE/HTTP)
        ▼
  MCP Server (e.g., AgentRQ)
        │
        ▼
  External Service / Tool
```

The protocol has three primitives:

- **[Tools](mcp-tool)** — Functions the agent can call (e.g., `createTask`, `reply`)
- **Resources** — Data sources the agent can read (e.g., files, databases)
- **Prompts** — Reusable prompt templates the server exposes

## MCP and AgentRQ

AgentRQ is an MCP server. When you add AgentRQ to your [Claude Code](claude-code) configuration, Claude Code becomes an [MCP client](mcp-client) that can call AgentRQ's tools:

- `createTask` — Create a task on your [task board](task-board)
- `reply` — Send a message to the human
- `getTaskMessages` — Retrieve human replies
- `updateTaskStatus` — Mark tasks as ongoing or completed
- `downloadAttachment` — Retrieve files attached to tasks
- `getWorkspace` — Get workspace configuration and context

## MCP Transport Options

| Transport | Description |
|-----------|-------------|
| stdio | Local server, communicates over stdin/stdout |
| HTTP + SSE | Remote server, uses HTTP for requests and [SSE](sse) for streaming |

AgentRQ uses HTTP + SSE transport, enabling real-time [notifications](notification) from anywhere.

## Related Terms

- [MCP Client](mcp-client)
- [MCP Server](mcp-server)
- [MCP Tool](mcp-tool)
- [SSE](sse)
- [Claude Code](claude-code)
