If you're building with LLMs, you'll eventually hit this question: do I write an MCP server or just write a tool? The answer is annoyingly, "it depends!".
Both work. One is a system boundary. The other is a function boundary. Picking the wrong one won't break anything, but it will make your codebase harder to maintain. And your future self will take it personally.
What's a Tool?
A tool is usually just a callable function in your app. Small surface area. Fast to ship. Easy to test. If your model needs to "do a thing" inside one codebase, tools are great.
Write a tool when:
- The capability is local to your app (query a DB, format text, call one external API)
- You want tight control and low latency
- You're still iterating and don't want to sign up for extra infrastructure
import requests
def get_weather(city: str) -> dict:
# This weather function is about as simple as it gets.
# Real tools will have retries, better error messages, and maybe caching,
# but the idea is the same.
r = requests.get("https://api.example.com/weather", params={"q": city}, timeout=5)
r.raise_for_status()
return r.json()
Tools also fit nicely into your existing app telemetry. If you can unit test it like normal code and ship it with your app, that's a strong hint it should stay a tool.
What's an MCP Server?
An MCP server is a separate service that exposes tools/resources in a standardized way. It's what you reach for when you need reuse, separation, or governance.
MCP servers sound complicated, but they're really just HTTP endpoints with a standard interface. The complexity usually comes from everything around it: auth, logging, rate limits, deployment, and the fact that networks enjoy failing at the worst times.
Write an MCP server when:
- Multiple apps/agents need the same capability
- You need centralized auth, policy, rate limits, or audit logs
- You want to ship updates independently of the client
- The capability wraps something "serious" (data warehouse, internal APIs, regulated data)
Think of it this way - if multiple teams need the same capability, that's an MCP server.
Here's a tiny sketch:
# mcp_server.py (sketch)
from fastapi import FastAPI
app = FastAPI()
@app.post("/tools/weather")
def weather(payload: dict):
city = payload["city"]
# In real life you'd validate inputs, enforce auth/policy,
# log access, and handle failures without crying.
return {"city": city, "temp_c": 22.1}
Clients call it over the network, and you put it behind your normal security layers.
The trade-offs (what you'll learn after your third refactor)
- Tools: simple and fast, but they can turn into copy-pasted "utility sprawl" across repos.
- MCP servers: reusable and governable, but they add ops work and new failure modes (deploys, auth, timeouts, partial outages).
A quick consulting story: I've seen teams spin up MCP servers for capabilities that could have been a 10-line function. The ops overhead ate them alive. Suddenly they weren't "building AI." They were debugging why staging can't talk to prod because someone rotated a token and didn't tell anyone. Classic.
Here's a simple heuristic:
- If it's app-specific and small, write a tool.
- If it's shared, product-critical, or touches scary data, go with MCP.
A practical decision checklist
Ask:
- Will this be used by more than one app/team soon?
- Does it require auditability or access control?
- Do you need to update it without redeploying the client?
- Is your latency budget okay with a network hop?
If you answered "yes" to most of those, you probably want an MCP server.
For more context, see: Model Context Protocol
Start with tools. When you find yourself copying the same tool across three repos, that's when you know it's time for an MCP server. Much like choosing the right machine learning model, the key is matching the solution to your actual needs rather than reaching for the most complex option.
-Sethers