MCP Integration

Lexicon Garden provides a Model Context Protocol (MCP) endpoint for AI agent integration. MCP allows AI assistants to browse lexicon schemas, validate data, and explore the ATProtocol lexicon ecosystem.

The endpoint is read-only and requires no authentication — every tool can be called anonymously.

Endpoint

The MCP endpoint is available at /mcp using the Streamable HTTP transport. The home page advertises the endpoint via a <link rel="alternate"> tag for automated discovery.

Available Tools

describe_lexicon

Get detailed information about an ATProtocol lexicon schema, including its definition, usage examples, and localized documentation.

  • lexicon (required) — The NSID to describe, e.g. app.bsky.feed.post or app.bsky.actor.profile#viewBasic for a specific fragment
  • identity (optional) — DID or handle of the lexicon authority. If not provided, the authority is resolved via DNS.
  • language (optional) — ISO 639 language code for localized descriptions from garden.lexicon.documentation records

validate_lexicon

Validate a lexicon schema and optionally validate data against it. Use this to verify schema correctness and validate records, query parameters, or procedure inputs.

  • schema (required) — The lexicon schema document
  • params (optional) — Query parameters to validate
  • input (optional) — Procedure input body to validate
  • record (optional) — Record data to validate
  • flags (optional) — Validation flags: allowLegacyBlob, allowLenientDatetime, skipExternalRefs

check_compatibility

Compare two versions of a lexicon schema and detect breaking versus non-breaking changes, with migration guidance. Supply either two schema documents (from_schema + to_schema) or an NSID with two CIDs (nsid + from_cid + to_cid).

facet_text

Parse rich text facets (mentions, URLs, and hashtags) from plain text. Returns AT Protocol facets with correct UTF-8 byte offsets. Mentions are resolved to DIDs when possible.

  • text (required) — The plain text to parse for facets

create_record_cid

Generate a CID (Content Identifier) for an AT Protocol record using DAG-CBOR encoding and SHA-256 hashing, following AT Protocol conventions.

  • record (required) — The JSON record object

discover_permission_sets

Discover which ATProtocol permission-set lexicon schemas cover a given set of collections and/or XRPC methods. Returns matching permission sets with their OAuth scope strings (include:<nsid>), useful for determining what OAuth scopes an application needs.

  • collections (required) — Collection NSIDs your application reads or writes
  • methods (optional) — XRPC method NSIDs your application calls

Prompts

  • oauth_scope_guide — Guide for discovering the OAuth scopes an application needs based on the collections it uses and the XRPC methods it calls. Walks through discover_permission_sets, browsing lexicon namespaces, and choosing between existing permission-sets and granular scopes.

Resources

  • mcp://server-card.json — The MCP server card for this instance
  • lexicon://browse/{prefix} — Browse the lexicon namespace tree by dot-separated NSID prefix (or empty for the root)

Connecting an MCP Client

To connect an MCP client (such as Claude Desktop or another AI assistant), configure it with the server URL:

https://lexicon.garden/mcp

The endpoint uses the Streamable HTTP transport and needs no credentials. Refer to your MCP client's documentation for configuration details.

Lexicon Garden

@