Decision guide
MCP vs In-App Tool Calling
Should your agent's tools be defined in your app, served over MCP, or not be model tools at all?
Side by side
| Criterion | In-app tool definitions | Local MCP server (stdio) | Remote MCP server (HTTP) | Plain API call in code |
|---|---|---|---|---|
| Who decides to call it | The model | The model | The model | Your code |
| Reuse across apps | Copy per app | Any MCP host on the machine | Any authorised MCP client | Library or service reuse |
| Auth and permissions | Your app's session | Local credentials; sandbox the process | OAuth resource server; per-client scopes | Your app's session |
| Latency and moving parts | Lowest | Process hop | Network hop, another service | Lowest |
| Security risk | Your code only | Third-party servers run locally: review them | Network exposure; token handling | Lowest |
When to choose each
In-app tool definitions
Define tools (name, description, JSON schema) in your application and run them in-process when the model asks.
Choose when
- One app uses the tools
- Tools need the app's own context (user session, permissions)
- Lowest latency and fewest moving parts
Avoid when
- Several apps need the same integrations
Local MCP server (stdio)
Wrap a system in an MCP server that the host app starts as a subprocess and talks to over stdio.
Choose when
- Developer tools and desktop apps (IDEs, coding agents)
- Reusing community or vendor MCP servers locally
Avoid when
- Shared servers for many users (each user runs their own)
Remote MCP server (HTTP)
Run the MCP server as a network service (Streamable HTTP) with OAuth, used by many clients.
Choose when
- Many AI apps or teams need the same system
- Central auth, rate limits, auditing and versioning per integration
Avoid when
- A single app where a network hop adds no value
Plain API call in code
Your code calls the API itself at a fixed step; the model never decides whether to call it.
Choose when
- The step always happens (fetch the user's profile before answering)
- Deterministic workflows
Avoid when
- The model must choose between many actions based on the conversation
Verdict
Use plain code for steps that always happen, in-app tools when one application owns the integration, and MCP when the same integration should serve many apps: local stdio servers for developer tools, remote servers with OAuth for shared, governed integrations. Whatever the transport, design tools for agent tasks, keep outputs small and require approval for destructive actions.
Learn more
- Integrating LLM APIs
- AI Agents and MCP in Production
- API Design
- Write a bounded tool-calling loop (AI & LLM APIs)
- Expose an internal API as an MCP server (AI & LLM APIs)
- Use MCP server tools from your own app (AI & LLM APIs)