Published 2026-10-14 · Updated 2026-10-25

Why MCP Beats a REST Call for Agent Workflows

A REST call works once. An MCP server tells the agent what exists, what the parameters are, and what comes back — so it can plan without being taught each endpoint. When to use which.


On this page

The question

The first guide showed both paths: a REST call in a script, and an MCP server. Both work. So why would you pick one?

The difference is not capability. It is who knows what exists.


A REST call is a contract you carry

When you write a REST call, the knowledge of the endpoint lives in your code — or in the prompt you gave the agent.

r = httpx.get("https://api.ashareapi.com/v1/kline",
              params={"code": "sh600519", "period": "day", "count": 250})

This is fine, and it is what most people start with. But notice what the agent knows: exactly one URL, and only because you told it. Ask about a different field and it either guesses or asks you.

A REST call scales with the number of things you remember to teach.


An MCP server is a contract the agent can read

With an MCP server, the agent is handed a description of what exists:

{
  "mcpServers": {
    "ashareapi": {
      "type": "http",
      "url": "https://api.ashareapi.com/mcp"
    }
  }
}

Claude Code needs type; Cursor takes the same object without it; Codex uses TOML.

Then the agent can:

It can Because
Discover what tools exist The server lists them
Read each tool’s parameters Each tool declares its schema
Know the shape of what comes back The schema is stated, not guessed
Plan a multi-step question It can see the pieces before choosing

That is the difference: the agent stops guessing what is possible, and starts selecting from what is.


Why this matters for trading workflows

A trading question is rarely one call. “Which of these stocks had the highest volume last week, and what was happening in the sector?” is a plan, not a lookup.

Approach What the agent does
REST, taught endpoint by endpoint Calls what you listed, stops when it runs out
MCP, tools discovered Picks the tools the question needs, chains them

The failure mode of the first approach is silent: the agent does not say “I only know one endpoint”. It answers with what it has — which is how a thin data set becomes a confident wrong answer.


When REST is still the right choice

MCP is not always better. Use a plain REST call when:

  • It is one fixed request, run on a schedule — no planning needed
  • You are inside a system that already knows the endpoints
  • The client does not support MCP — a scripted call is a complete solution

The rule: use MCP when the agent should decide which tools to use. Use REST when you have already decided.


The verification rule still applies

Whichever path you pick, the check from the definitions page holds: the number must come from a call you can re-run.

MCP makes a tool discoverable. It does not make it correct. You still need:

  • The window stated in the call
  • The field named precisely
  • The same request producing the same series

Discovery is not verification. They are two different steps, and the second one is yours.


Try it

# Same series, any time — the request fully determines the result.
curl "https://api.ashareapi.com/v1/kline?code=sh600519&period=day&count=250"

Then point an MCP-capable client at the server and ask a question that needs two steps. Watch whether it chooses tools, or asks you what to call.


Next

Sources