Skip to content

feat(mcp): views in list_tables, describe_table and sample_rows (#1133) - #1268

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
feat/1133-mcp-views
Oct 10, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
feat/1133-mcp-views

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

First slice of MCP v2 (#1133): the docs said "views are not listed yet". A model could not see a view that an application's reads go through.

  • list_tables returns views next to tables, marked "kind": "view" (PostgreSQL materialized views included); tables keep their exact shape.
  • describe_table of a view returns its columns, with no primary key and no index query.
  • sample_rows reads a view through its validated, quoted name, like a table: the name must come from the catalog, so model input never reaches SQL unchecked.
  • One extra catalog query per call, ErdCatalog.viewColumnsSql, on the same read-only MCP session. A name that is already a table stays a table.
  • docs/mcp-server.md and the tool description say so.

Tests (mcp_query_service_test): views listed with kind, a view that is also a table stays a table, describe_table of a view runs no index query, sample_rows quotes the view.

Test plan

  • CI: all test sections pass, including mcp_security_test and the SQLite read-only test on a real database (no local runs, per team rule)

…1133)

The MCP catalog read only base tables, so a model could not see a view the
user's database is organised around. list_tables now also returns views
(PostgreSQL materialized views included) with kind: view; describe_table
gives their columns (no keys, no indexes) and sample_rows reads them.

A name that is already a table stays a table. The views come from one extra
catalog query per call (ErdCatalog.viewColumnsSql), read on the same
read-only MCP session.
@github-actions github-actions Bot added epic Epic / umbrella issue integration Theme parser epic label: integration core Core library logic and services P2 Medium priority / Parity & Refactoring labels Oct 10, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 9a8ac65 into dev Oct 10, 2026
13 checks passed
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the feat/1133-mcp-views branch October 11, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core library logic and services epic Epic / umbrella issue integration Theme parser epic label: integration P2 Medium priority / Parity & Refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant