Add RFC for supporting MCP with Presto#53
Add RFC for supporting MCP with Presto#53agrawalreetika wants to merge 1 commit intoprestodb:mainfrom
Conversation
e00718d to
57e25e0
Compare
RFC-0022-Model-Context-Protocol.md
Outdated
| - Implement the core MCP primitives: | ||
| - `tools/list` for tool discovery | ||
| - `tools/call` for executing tools | ||
| - Initially provide a single tool: `query.run`, which executes SQL queries against Presto. |
There was a problem hiding this comment.
Any restriction on the type of queries supported? If it's a DML, might we need a new tool to support it, since they don't return data but return metadata about what was modified?
There was a problem hiding this comment.
Yes — query.run is intentionally limited to read-only, row-producing queries.
LLM agents primarily issue analytical (SELECT-style) queries, and MCP tools are designed to return tabular JSON data.
My understanding is that if support for mutations is needed later, they could be exposed as separate MCP tools with their own semantics.
RFC-0022-Model-Context-Protocol.md
Outdated
| - Initially provide a single tool: `query.run`, which executes SQL queries against Presto. | ||
| - Internally communicate with Presto coordinators using standard Presto HTTP APIs. | ||
| - Forward OAuth/JWT Bearer tokens transparently from MCP clients to Presto, ensuring that Presto performs all authentication and authorization checks. | ||
| - Translate between the two protocols, aggregating streaming results into a single response. |
There was a problem hiding this comment.
What if the query requests too much data and creates memory pressure in the MCP server?
There was a problem hiding this comment.
Good point - Although results are aggregated, the MCP server enforces a strict row limit (auto-injected if missing), ensuring memory is bounded and preventing large result sets from being materialized.
I am open to suggestions if additional safeguards should be added.
RFC-0022-Model-Context-Protocol.md
Outdated
| - Table metadata tools | ||
| - Query explanation tools | ||
|
|
||
| ## WIP - Draft PR Changes |
There was a problem hiding this comment.
| ## WIP - Draft PR Changes |
I presume it's not WIP anymore?
RFC-0022-Model-Context-Protocol.md
Outdated
| - Implement the core MCP primitives: | ||
| - `tools/list` for tool discovery | ||
| - `tools/call` for executing tools | ||
| - Initially provide a single tool: `query.run`, which executes SQL queries against Presto. |
There was a problem hiding this comment.
I presume this will also run SHOW catalogs; and other statements ?
There was a problem hiding this comment.
Yes, query.run in the initial version is intentionally limited to read-only, row-producing queries (e.g., SELECT, SHOW, DESCRIBE).
Then there would be additional metadata oriented different tools - metadata.listCatalogs, metadata.listSchemas, metadata.listTables, metadata.getColumns
Thanks for pointing out, will update RFC details as well.
57e25e0 to
e869790
Compare
hantangwangd
left a comment
There was a problem hiding this comment.
@agrawalreetika thanks for this interesting proposal. Is there a prototype or draft PR already in the works that we could look at?
Add RFC for supporting MCP with Presto