> Site index: https://usehardal.com/llms.txt
> Every content route also serves markdown at <url>.md

# What Is the Model Context Protocol (MCP)?

The Model Context Protocol (MCP) is an open JSON-RPC standard created by Anthropic that connects AI assistants to external tools, data sources, and prompts.

Source: https://usehardal.com/glossary/model-context-protocol

---

The Model Context Protocol (MCP) is an open specification created by Anthropic that standardizes how AI applications connect to external tools, data, and context. Before MCP, every AI app had to build custom integrations for every database, analytics tool, or SaaS API. MCP replaces that one-off glue code with a shared JSON-RPC 2.0 interface.

In marketing and commerce stacks, MCP has two primary roles: letting analysts query live campaign and revenue metrics inside an AI assistant, and letting shopping or operational agents call merchant tools such as inventory lookup or order status.

## How does the Model Context Protocol work?

MCP defines three architectural roles communicating via JSON-RPC 2.0 messages, running locally over standard I/O (`stdio`) or remotely over HTTP with OAuth-based authorization.

1. **Host.** The AI application the user interacts with, such as Claude, ChatGPT, Cursor, or Codex.
2. **Client.** The connector inside the host that negotiates capabilities with a server and relays tool calls and results.
3. **Server.** A service operated by a vendor or engineering team that advertises capabilities (`server/discover` in the `2026-07-28` specification) and exposes three core primitives: **Tools** (executable functions with typed input schemas), **Resources** (structured read-only context), and **Prompts** (reusable task templates).

When a user asks a question, the model does not read the underlying database directly. It selects an advertised tool, passes structured arguments such as date ranges and filters, and forms its answer strictly from what the server returns.

## A concrete example

A growth lead asks Claude: "Which channels drove the most purchases last week, and how did they compare with the week before?" The host passes the question to a connected analytics MCP server, which exposes a read-only tool such as `get_top_campaigns`.

The model invokes `get_top_campaigns` with two date ranges. The MCP server runs an aggregated query against [first-party data](https://usehardal.com/glossary/first-party-data), returns totals by channel and campaign without exposing individual customer emails, and the assistant presents the comparison along with the exact metrics returned. Because the server exposes read-only tools only, the model cannot modify tracking tags or pause campaigns.

## Common pitfalls in marketing MCP setups

- **Mixing platform-attributed MCP servers in cross-channel math.** Asking an assistant to sum conversions from a Google Ads MCP server and a Meta MCP server double-counts overlapping orders because each platform uses its own attribution window.
- **Granting write permissions too early.** Exposing tools that edit budgets, bids, or Google Tag Manager containers without human approval risks silent production changes.
- **Leaking visitor-level PII into model context.** Returning raw user rows instead of aggregated metrics increases privacy exposure without improving business answers.
- **Skipping metric definitions.** If a tool returns a generic `value` column without stating currency, refund handling, or attribution window, the model may misinterpret the metric.

## MCP vs UCP and A2A

MCP, [Universal Commerce Protocol (UCP)](https://usehardal.com/glossary/universal-commerce-protocol), and Agent2Agent (A2A) operate at complementary layers rather than competing for the same job. MCP connects an AI host to tools and data; A2A connects one agent to another agent; and UCP standardizes commerce discovery, cart, checkout, and order lifecycle, using MCP or REST as its transport.

## How Hardal helps

Hardal is the first-party data and agentic analytics platform. Hardal MCP connects Claude, ChatGPT, Codex, and other MCP clients to your live [agentic analytics](https://usehardal.com/glossary/agentic-analytics) over read-only, aggregated endpoints such as `get_analytics_overview`, `get_analytics_event_counts`, and `get_top_campaigns`. Because queries run on your server-side first-party event stream, cross-channel numbers follow one consistent definition and visitor-level PII stays out of the model context. To evaluate and roll out servers safely, read [MCP Servers for Marketing Analytics: Connect Ad Data to AI](https://usehardal.com/blog/mcp-servers-for-marketing-analytics).
