top | item 44074489

(no title)

jsmith99 | 9 months ago

I just use a MCP server (with copilot or cline) that has a read only login to my database.

discuss

order

BoorishBears|9 months ago

Which is strictly worse than just giving the LLM access to the source of truth for the database.

You're adding a round trip to the database and the LLM and inserting a tool call in the conversation before it even starts generating any code.

And the reference Postgres MCP implementation doesn't include Postgres types or materialized views, and is one of the most widely used packages: Zed.dev's MCP server for example, is seemingly just a port of it and has the same problem.

fwip|9 months ago

MCP also gives the LLM access to your example data, which can add clarity beyond what your schema alone provides.

tempaccount420|9 months ago

I don't see how a round trip of <500ms, which is equivalent to maybe 50 tokens, is worse than including many thousands more extra tokens in the prompt, just in case they might be useful. Not to mention the context fatigue.

If designed well - by suspending generation in memory and inserting a <function_result>, without restarting generation and fetching cache from disk - the round trip/tool call is better (costs the equivalent of 50 tokens for waiting + function_result tokens).

nsonha|9 months ago

The schema in the db should be the source of truth and an MCP server like that is the most flexible, can work with any ORM set up

wredcoll|9 months ago

What source of truth? If you have access to the database then you have the actual truth right there.

layoric|9 months ago

Out of interest.. does the resultant data get used by the LLM or just generating SQL, executing and returning separately?

maxluk|9 months ago

PM on the project here - The results from the query are generally not used by the LLM. In agent mode though, during query planning, the agent may retrieve sample of the data to improve precision of the queries. For example, getting distinct values from dimensional table to resolve filter condition from natural language statement.