Skip to main content

AI SDK

The AI SDK gives you programmatic access to OpenMetadata’s MCP tools — use them to build custom AI applications with any LLM by connecting to your metadata catalog. Available across Python, TypeScript, and Java.
Using Collate? You also get access to AI Studio Agents — ready-to-use AI assistants that you can create, manage, and invoke programmatically. See the Collate AI SDK documentation for the full agent capabilities.
You can find the source code for the AI SDK in the GitHub repository. Contributions are always welcome!

Available SDKs

SDKPackageInstall
Pythondata-ai-sdkpip install data-ai-sdk
TypeScript@openmetadata/ai-sdknpm install @openmetadata/ai-sdk
Javaorg.open-metadata:ai-sdkMaven / Gradle

Prerequisites

You need:
  1. An OpenMetadata instance (self-hosted or Collate)
  2. A Bot JWT token for API authentication
To get a JWT token, go to Settings > Bots in your OpenMetadata instance, select your bot, and copy the token.

Configuration

Set the following environment variables:
All environment variables:
VariableRequiredDefaultDescription
AI_SDK_HOSTYes-Your OpenMetadata server URL
AI_SDK_TOKENYes-Bot JWT token
AI_SDK_TIMEOUTNo120Request timeout in seconds
AI_SDK_VERIFY_SSLNotrueVerify SSL certificates
AI_SDK_MAX_RETRIESNo3Number of retry attempts
AI_SDK_RETRY_DELAYNo1.0Base delay between retries (seconds)

Client Initialization


MCP Tools

OpenMetadata exposes an MCP server that turns your metadata into a set of tools any LLM can use. Unlike generic MCP connectors that only read raw database schemas, OpenMetadata’s MCP tools give your AI access to the full context of your data platform — descriptions, owners, lineage, glossary terms, tags, and data quality results. The MCP endpoint is available at POST /mcp using the JSON-RPC 2.0 protocol.

Available Tools

ToolDescription
search_metadataSearch across all metadata in OpenMetadata (tables, dashboards, pipelines, topics, etc.)
semantic_searchAI-powered semantic search that understands meaning and context beyond keyword matching
get_entity_detailsGet detailed information about a specific entity by ID or fully qualified name
get_entity_lineageGet upstream and downstream lineage for an entity
create_glossaryCreate a new glossary in OpenMetadata
create_glossary_termCreate a new term within an existing glossary
create_lineageCreate a lineage edge between two entities
patch_entityUpdate an entity’s metadata (description, tags, owners, etc.)
get_test_definitionsList available data quality test definitions
create_test_caseCreate a data quality test case for an entity
root_cause_analysisAnalyze root causes of data quality failures

Using MCP Tools Directly

You can call MCP tools directly through the SDK client:

LangChain Integration

Convert OpenMetadata’s MCP tools to LangChain format with a single method call. This lets you use your metadata as tools in any LangChain agent.

Tool Filtering

Control which tools are exposed to your LLM by including or excluding specific tools. This is useful for restricting agents to read-only operations or limiting scope.

Multi-Agent Orchestrator

Build a multi-agent system where specialist agents each get focused MCP tools:

OpenAI Integration

Convert MCP tools to OpenAI function calling format: