Skip to content

feat(mcp): add list_tags and get_tag_info MCP tools#40300

Draft
aminghadersohi wants to merge 2 commits into
masterfrom
mcp-tags-99978
Draft

feat(mcp): add list_tags and get_tag_info MCP tools#40300
aminghadersohi wants to merge 2 commits into
masterfrom
mcp-tags-99978

Conversation

@aminghadersohi
Copy link
Copy Markdown
Contributor

SUMMARY

Adds list_tags and get_tag_info MCP tools in a new superset/mcp_service/tag/ domain, following the established pattern used by the database, dataset, and dashboard domains.

New files:

  • superset/mcp_service/tag/__init__.py
  • superset/mcp_service/tag/schemas.pyTagFilter, TagInfo, TagList, ListTagsRequest, GetTagInfoRequest, TagError, serialize_tag_object()
  • superset/mcp_service/tag/tool/list_tags.py — list tags with filtering, search, pagination
  • superset/mcp_service/tag/tool/get_tag_info.py — get a single tag by numeric ID
  • tests/unit_tests/mcp_service/tag/tool/test_tag_tools.py — unit tests covering basic listing, search, filters, empty results, error handling, not-found, and type serialization

Both tools are registered in app.py.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A — MCP tool additions only.

TESTING INSTRUCTIONS

  1. Run unit tests:
    pytest tests/unit_tests/mcp_service/tag/
  2. Start the MCP server and verify list_tags and get_tag_info appear in the tool list.
  3. Call list_tags with no arguments — should return the first page of tags.
  4. Call get_tag_info with a valid tag ID — should return tag name, type, and description.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration
  • Introduces new feature or API
  • Introduces new feature or API — adds two new MCP tools for tag discovery
  • Removes existing feature or API

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

❌ Patch coverage is 62.16216% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.14%. Comparing base (f187a8e) to head (ba361ff).
⚠️ Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
superset/mcp_service/tag/schemas.py 73.56% 22 Missing and 1 partial ⚠️
superset/mcp_service/tag/tool/list_tags.py 39.39% 20 Missing ⚠️
superset/mcp_service/tag/tool/get_tag_info.py 43.47% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #40300      +/-   ##
==========================================
- Coverage   64.14%   64.14%   -0.01%     
==========================================
  Files        2592     2596       +4     
  Lines      138841   138993     +152     
  Branches    32201    32209       +8     
==========================================
+ Hits        89064    89160      +96     
- Misses      48245    48300      +55     
- Partials     1532     1533       +1     
Flag Coverage Δ
hive 39.38% <62.16%> (+0.05%) ⬆️
mysql 58.86% <62.16%> (+0.01%) ⬆️
postgres 58.95% <62.16%> (+0.01%) ⬆️
presto 41.05% <62.16%> (+0.05%) ⬆️
python 60.50% <62.16%> (+<0.01%) ⬆️
sqlite 58.59% <62.16%> (+0.01%) ⬆️
unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aminghadersohi aminghadersohi force-pushed the mcp-tags-99978 branch 4 times, most recently from bdab1aa to cc7978c Compare May 21, 2026 20:10
aminghadersohi and others added 2 commits May 21, 2026 21:14
Adds list_tags and get_tag_info MCP tools in a new superset/mcp_service/tag/
domain, following the existing database/dataset/dashboard patterns.
Registers both tools in app.py and covers them with unit tests.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…upport

TagFilter documents 'ct' as a valid operator but ColumnOperatorEnum was
missing it, causing ValidationError when constructing TagFilter with opr="ct".
Added ct = "ct" with ilike("%val%") mapping, updated TYPE_OPERATOR_MAP for
string columns, and updated base_dao_test to cover the new operator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant