Model Context Protocol (MCP)
The Model Context Protocol (MCP) is an open standard developed by Anthropic that enables AI agents to access external tools and data sources through a standardized interface, allowing any compatible AI client to connect to any MCP-compatible provider.
Before MCP, integrating an AI agent with external data required bespoke API work for each combination of agent and data source. A team using two AI clients with three data providers needed six separate integrations. MCP collapses this to a single protocol: build one MCP server, and any MCP-compatible client can use it. The same data becomes available to Claude Code, ChatGPT, Codex, Cursor, Copilot, and any other agent that implements the standard.
MCP defines a set of primitives — tools, resources, and prompts — that servers expose and clients can call. For legal applications, the tools primitive is most relevant: it allows an AI agent to call a function ("search for case law on this topic") and receive a structured result that the agent incorporates into its reasoning. The agent decides when and how to use the tool; the MCP server provides the data without dictating the workflow.
MCP is transport-agnostic — it works over stdio, HTTP with server-sent events, or WebSockets. For hosted legal data services like Legalcode, the remote HTTP transport allows practitioners to connect from any machine without installing local software. The connection is established once; authentication is handled by a token embedded in the MCP server configuration.
How Legalcode uses the Model Context Protocol
- Legalcode is implemented as a remote MCP server, accessible over HTTP from any MCP-compatible AI client — no local installation required beyond a one-line configuration change.
- The MCP tool interface exposes law search, case law search, and regulatory guidance retrieval as discrete tools, so agents can call them selectively within a broader workflow rather than retrieving bulk data.
- Token-based authentication is embedded in the MCP server URL, so practitioners connect with a single configuration change and the same token works across all clients they use.