Skip to content

MCP knowledge-graph tools: non-admin access and column-level lineage at scale #34270

Closed

Description

@fmcardoso

Parent epic: https://github.com/open-metadata/ai-platform/issues/224 ("Make the MCP knowledge-graph tools usable by non-admin MCP clients for large lineage questions").

Problem

A customer on 2.0.1 needed column-level lineage at scale through MCP:

  • get_entity_lineage with includeColumnLineage=true clipped the graph to 139 of 4,523 edges;
  • there is no pagination, no way to start from a column, and no edge filters;
  • the workaround was search_metadata for each column, then one lineage call per column. That's many calls, and it breaks when a downstream consumer renames the field.
  • AskCollate couldn't answer either.

The team agreed on two paths, so RDF doesn't become mandatory for OSS:

  • Fix get_entity_lineage (start from a column FQN, a pagination cursor, edge filters). Tracked in the MCP epic, not here.
  • Offer the knowledge graph through MCP, this issue, with an internal check that RDF is enabled and a graceful answer otherwise.

Most of the MCP graph tooling already exists (#28042, 2026-08-30): sparql_query, entity_neighborhood, ontology_describe, shacl_validate. RdfMcpTool.repository() already throws RdfNotEnabledException when RDF is off, so the graceful check is there. What blocks this use case:

  1. The tools are admin-only. RdfMcpTool.execute calls authorizer.authorizeAdmin(securityContext), and bot tokens are rejected, so ordinary MCP users can't use them at all.
  2. A single answer can't fit. Responses are capped at 80 KB (RdfBody.MAX_BYTES). 4,523 column edges at about 150 bytes each is roughly 680 KB, so one query comes back truncated. SPARQL can page (ORDER BY + LIMIT/OFFSET) and filter (type, service, owner), but sparql_query's description doesn't tell external clients to.
  3. Following a column across many hops is unproven. Column lineage is projected (RdfRepository, the lineage-details node → om:hasColumnLineage → om:ColumnLineage with om:fromColumn / om:toColumn / om:transformFunction). But the column FQNs are plain string literals, not column resources.
    • Starting from a column FQN works.
    • Following it across hops needs a join on those strings at each hop, e.g. "<col>" (^om:fromColumn/om:toColumn)+ ?downstream. That's untested, and may be slow at thousands of edges.
  4. External clients get no vocabulary guidance. sparql_query's description has examples but not the rules ai-platform's queryKnowledgeGraph needed: lineage direction (?output om:upstream ?source), binding assets by om:fullyQualifiedName, binding owners, tiers and tags. The ai-platform My Data and Followers are empty #1348 benchmark showed the model depends on them.

Scope

  • Authorization: non-admin access through the ExecuteSparqlQuery permission (as the agent endpoint does, Add permissioned read-only SPARQL execution for the 2.1 graph agent tool #33384) instead of authorizeAdmin, keeping the RDF-off check. Decide whether bot tokens are allowed.

  • Verify column-lineage traversal on a realistic graph (thousands of edges): from one column FQN, return every downstream (and upstream) column across hops, within the query timeout.

    • Record the working query, or the reason it doesn't work.
    • If the string-literal model can't do it, propose the change (e.g. project columns as resources with om:hasColumn plus column-to-column edges) before building anything else.
  • Guidance for external clients in sparql_query's description, within its budget:

    • how to page large results (ORDER BY + LIMIT/OFFSET, and what to do with truncated: true);
    • how to filter edges;
    • the core vocabulary rules above;
    • a column-lineage query template.

    Point to ontology_describe for the rest, which must also be reachable by non-admins.

  • Tests: authorization (admin, granted user, ungranted user, bot token, RDF off → graceful error), and a column-lineage fixture queried across several hops, including paging.

  • Benchmark: add a question of this shape (column lineage from one column, thousands of edges, with a filter) to ai-platform's graph benchmark (benchmarks/data/collate_graph_routing_v1.tsv). The generated catalog has no column lineage today, so the fixture needs it.

Out of scope

Done when

A non-admin MCP client with ExecuteSparqlQuery can:

  • get the complete downstream column lineage of one column on a graph with thousands of edges, paging through sparql_query;
  • filter it by asset type;
  • get a clear "RDF is not enabled" answer on a deployment without RDF.

Related: ai-platform#224, ai-platform#1370, ai-platform#1348, #28042, #33384, #33224.

Activity

  1. self-assigned this
    on Sep 30, 2026
  2. added
    P0
    security
    on Sep 30, 2026
  3. removed
    P0
    on Sep 30, 2026
  4. moved this to Release Backlog 🚧 in Shippingon Sep 30, 2026
  5. moved this from Release Backlog 🚧 to In Progress 🏗️ in Shippingon Oct 1, 2026
  6. added theissue type on Oct 2, 2026
  7. added
    bug
    on Oct 2, 2026
  8. added 2 commits that reference this issue on Oct 7, 2026
    1a5504f
    acf8961
  9. 12 remaining items

  10. added 10 commits that reference this issue on Oct 7, 2026
    1f141b6
    1d95132
    fb5cbc8
    4489aac
    f591bd3
    bb1f17c
    e01ac33
    2172592
    328b866
    5596ca5
  11. moved this from In Progress 🏗️ to In Review / QA 👀 in Shippingon Oct 13, 2026
  12. moved this from In Review / QA 👀 to Done ✅ in Shippingon Oct 14, 2026
  13. added a commit that references this issue on Oct 14, 2026
    77e23a2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

backendbuglineagemcpsecurity

Type

Projects

  • Status
    Done ✅
  • Status
    Done ✅

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions