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.
- Host. The AI application the user interacts with, such as Claude, ChatGPT, Cursor, or Codex.
- Client. The connector inside the host that negotiates capabilities with a server and relays tool calls and results.
- Server. A service operated by a vendor or engineering team that advertises capabilities (
server/discoverin the2026-07-28specification) 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, 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
valuecolumn without stating currency, refund handling, or attribution window, the model may misinterpret the metric.
MCP vs UCP and A2A
MCP, Universal Commerce Protocol (UCP), 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 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.
Frequently asked questions
What is the Model Context Protocol (MCP)?
The Model Context Protocol (MCP) is an open specification introduced by Anthropic that standardizes how AI applications (hosts) connect through clients to external servers exposing tools, resources, and prompts over JSON-RPC 2.0.
How does MCP differ from a traditional REST API?
A REST API exposes fixed endpoints for developers to hardcode into an application. MCP adds a standard discovery and invocation layer (tools, resources, and structured schemas) so any compatible AI host such as Claude, ChatGPT, or Codex can discover and call an external service without custom glue code.
What can an MCP server expose to an AI assistant?
An MCP server can expose Tools (executable actions or queries such as get_top_campaigns), Resources (readable files, records, or context), and Prompts (reusable workflow templates), along with authorization rules and multi-round-trip input patterns.
How is MCP used in marketing analytics and agentic commerce?
In marketing analytics, MCP servers let AI assistants query campaign spend, conversion counts, and warehouse metrics in plain language. In agentic commerce, MCP serves as a transport layer for agents to check merchant inventory, pricing, or order status.
What are the security risks of connecting MCP servers to analytics or ad accounts?
Over-broad write tools, shared API keys, or exposing raw visitor-level PII inside a model context create privacy and operational risks. Teams should start with read-only aggregate tools, per-user OAuth authentication, and explicit human approval before any write action.