top | item 45407092

(no title)

jmcodes | 5 months ago

So this is a first pass to capture the workflow part (mix code and MCP calls).

The fetch code isn't any better than the tool code I agree, but typescript code is more common so I'd guess this would be too?

But anyway I think the real power comes with the type-safety part that I left out this morning (working on it now). From what I understand Cloudflare is essentially generating an SDK for the LLM to write code against.

Instead of writing that fetch call. The LLM would generate

``` const redditResults = await redditMCP_getTopPosts(subreddit); const insertMutation = await duckdb_Insert("SQL STUFF", redditResults.map(...)); const results = await duckDb_Query(args: duckDb_QueryArgs); return resultsInSomeNiceFormat; ```

Where the method names come from the MCP server tools, and the argument types are autogenerated from the MCP schemas themselves.

No idea if this is a valuable workflow or not personally. I just thought it was cool and wanted to tinker with it.

discuss

order

danielser|5 months ago

Correct, this is like giving the LLM full specs on your GraphQL endpoint, and telling it have fun, get only what you need.

Except it can use Typescript to manipulate the data mid stream.

So in reality this is MCP Middleware + MCP Orchestration + Tool Call Efficiency.

It will save tokens as well due to only returning what it needs, but more so just think of going from 10 consecutive tool calls, to 1 call that gives you everything you need and nothing you don't, with 1/10th the time taken to accomplish.