Tool servers for assistants, explained without the hype

The Model Context Protocol, usually shortened to MCP, has turned into a small ecosystem of its own. Hobbyists publish servers that let an assistant draw animations on a pixel display, render video with a Python library or control a CAD program, and developers regularly ask how to connect a server that speaks an older protocol such as XML-RPC to the coding assistant in their editor.
This article is for builders wondering whether MCP belongs in their prototype. It explains what the protocol is in plain terms, how a server wraps an existing program, how to bridge legacy interfaces, and when a simpler pattern, a model returning a JSON action that your own code executes, is the better first step. It includes a minimal MCP server and a protocol-free alternative you can run against this site's free endpoint.
Frequently asked questions
What is MCP in one sentence?
An open protocol, introduced by Anthropic and now supported by many tools, that standardises how an AI application discovers and calls external tools, reads resources and uses prompt templates provided by separate programs called servers.
How does an MCP server differ from a normal API?
A normal API is designed for programs written by developers who read its documentation. An MCP server describes its tools in a machine-readable way so that an AI client can list them, show them to a model and call them on the model's behalf without custom integration code.
What is the difference between an MCP client and a server?
The client lives inside the AI application, such as a desktop assistant, coding agent or editor extension. The server is a separate program that exposes tools. One client can connect to many servers, and one server can be used by many clients.
Can MCP talk to a program that only offers XML-RPC?
Not directly, but a small MCP server can act as a bridge: it exposes MCP tools to the assistant and, inside each tool, calls the legacy XML-RPC interface. Python's standard library includes an XML-RPC client, which makes such bridges short.
Which is better for a first prototype, MCP or a plain function call?
If your tool is used only by your own app, a plain function call from your code is simpler. MCP pays off when you want the same tool to work across several assistants, or when you are building a tool for other people's AI clients.
Does every model handle tools equally well?
No. Larger models choose tools and fill arguments more reliably. Smaller models more often pick the wrong tool or produce malformed arguments, so validation matters more with them.
Is MCP secure by default?
Security depends on the server. A server can do anything its code allows on the machine where it runs. Install servers only from sources you trust, give them the minimum permissions they need, and review what each tool does.
Can the free endpoint drive an MCP setup?
The endpoint provides text chat completions in OpenAI format. Whether a given MCP client can use it depends on the client supporting a custom OpenAI-compatible backend. The protocol-free pattern in this article works with it directly.
The problem MCP solves
Before a shared protocol, every AI application integrated tools its own way. A tool written for one assistant had to be rewritten for another. MCP standardises the conversation between the application and the tool: how the client discovers which tools exist, how their inputs are described, how a call is made and how results come back.
The result is a plug-in model. Someone writes a server for a video library once, and any MCP-capable client can use it. That is why so many small servers have appeared: wrapping a library or a device in a server makes it instantly available to several assistants at once.
Tools
Functions the model can ask to run, each with a name, description and input schema, for example render an HTML snippet or cut a video clip.
Resources
Data the client can read and include in context, such as files, records or documentation pages exposed by the server.
Prompts
Reusable prompt templates a server can offer, which clients may present to users as ready-made actions.
How a server wraps an existing program
Most useful servers are thin. They import an existing library or connect to an existing program, and expose a few of its capabilities as tools with clear descriptions. A server for a pixel display might expose tools to draw text or render HTML to the screen; a server for a video library might expose cutting, concatenating and adding subtitles.
Some projects go further and serve the same functionality through both MCP and a conventional web API, for example with a small web framework alongside the MCP server. That gives AI clients the protocol they prefer while scripts and other programs use ordinary HTTP. It is a sensible design when the underlying tool is useful on its own.
- Pick a small set of capabilities worth exposing
- Write one clear sentence per tool description
- Use simple, typed parameters
- Return concise results the model can read
- Log every call for debugging

A minimal MCP server in Python
The official Python SDK makes a basic server short. The example below exposes one tool that counts words in a text. Install the SDK with pip install mcp, save the file and register it in an MCP-capable client according to that client's documentation, usually by giving the command that starts the server.
The decorator turns the function's name, type hints and docstring into the tool description that the client shows to the model. Good docstrings therefore matter: they are the only explanation the model receives.
Transport
Local servers usually talk to the client over standard input and output. Remote servers use HTTP-based transports; check the SDK documentation for current options.
from mcp.server.fastmcp import FastMCP
mcp = FastMCP('text-tools')
@mcp.tool()
def word_count(text: str) -> int:
"""Count the words in a piece of text."""
return len(text.split())
if __name__ == '__main__':
mcp.run() # communicates with the client over standard input/outputBridging legacy interfaces such as XML-RPC
Plenty of desktop programs expose automation through older protocols. CAD tools, media servers and scientific software often offer XML-RPC or similar interfaces. An assistant cannot use these directly, and an MCP client will not speak XML-RPC. The fix is a bridge server: MCP on the outside, the legacy protocol on the inside.
In Python the inside is short, because xmlrpc.client is part of the standard library. Each MCP tool calls one remote method and returns its result. Keep the tool list small and descriptive rather than mirroring every remote method, since a model chooses better from a few clear options than from dozens.
Check the remote method names
The method names and port depend entirely on the program you bridge. Read its automation documentation and test calls in a Python shell before wrapping them.
Handle connection errors
If the desktop program is closed, the remote call fails. Catch the error and return a clear message so the model can tell the user what happened.
import xmlrpc.client
from mcp.server.fastmcp import FastMCP
mcp = FastMCP('legacy-bridge')
remote = xmlrpc.client.ServerProxy('http://localhost:9875') # the program's XML-RPC address
@mcp.tool()
def list_documents() -> list:
"""List the documents currently open in the desktop program."""
return remote.list_documents() # method name defined by the program's own API
if __name__ == '__main__':
mcp.run()
When a plain function call is enough
If the tool is used only by your own application, MCP adds a layer you may not need. A simpler pattern is to describe the available actions in the system prompt, ask the model to answer with a small JSON object naming the action and its arguments, validate that object in your code and run the function yourself. No protocol, no extra process.
This pattern works with any chat completion endpoint, including ones without native tool-calling features. The example uses this site's free endpoint, which serves free-ai, an independent open-weight model; the service is not affiliated with Anthropic and the model is not Claude.
Validate everything
Never execute an action the model names without checking it against an allow-list and checking argument types. Smaller models make more mistakes here.
import json
from openai import OpenAI
client = OpenAI(base_url='https://api.anthropicapifreekey.com/v1', api_key='unused')
ACTIONS = {
'word_count': lambda text: len(text.split()),
'upper': lambda text: text.upper(),
}
SYSTEM = ('Choose one action for the user request. Reply with JSON only: '
'{"action": "word_count" or "upper", "text": "..."}')
r = client.chat.completions.create(
model='free-ai', temperature=0, max_tokens=200,
messages=[{'role': 'system', 'content': SYSTEM},
{'role': 'user', 'content': 'How many words are in: the quick brown fox'}])
raw = r.choices[0].message.content.strip().strip('`').removeprefix('json').strip()
call = json.loads(raw)
if call.get('action') not in ACTIONS or not isinstance(call.get('text'), str):
raise ValueError(f'invalid action: {call}')
print(call['action'], '->', ACTIONS[call['action']](call['text']))Choosing between the two
The decision usually follows from who will use the tool. If it is your own app, start with function calls in your code; you can wrap the same functions in an MCP server later without changing them. If you want the tool available inside desktop assistants, coding agents and editors, MCP is the right investment, because it reaches all of them at once.
There is also a learning argument. Building a small MCP server teaches how assistants see tools, which improves how you describe functions even in your own code. A weekend spent wrapping a library you like is time well spent.
Own app only
Plain function calls and JSON actions: fewer moving parts, easier debugging, works with any model endpoint.
Many clients
MCP server: write once, use from any compatible assistant, share with others.

Model quality and tool use
Tool use is where model size shows clearly. Frontier models such as Claude are good at picking the right tool, filling arguments correctly and recovering when a call fails. Smaller models are more likely to call a tool that does not fit, invent an argument or loop on a failing call. This is a real reason to use a stronger model for agentic features in production.
For prototyping, a smaller model is still useful: it reveals unclear tool descriptions quickly, because it is less able to guess what you meant. If your tools work well with a modest model, they usually work very well with a strong one. Mind the context budget too, since every tool description is sent with each request; see the article on token-heavy prompts.
A practical check is to read your tool descriptions aloud as if to a new colleague. If a person would need to ask what a parameter means or when to use one tool instead of another, a model will struggle in the same place. Rewriting the descriptions is usually cheaper than switching to a bigger model.
Safety and limits for tool servers
A tool server runs code on your machine on behalf of a model. Treat it accordingly: install servers from sources you trust, read what each tool does, restrict file system and network access where possible, and require confirmation for anything destructive. Avoid giving one server broad powers when two narrow ones would do.
When you prototype with the free endpoint, remember its per-IP limits of 1 request per second with bursts of 3 and 2 in parallel, and that each request leaves a technical log with time, IP, User-Agent, country, endpoint, status, latency, sizes and tokens. Keep tool results that contain private data out of prompts. For pacing agent loops that call tools repeatedly, see the article on rate limits; for choosing an agent to host your tools, see the comparison of coding agents.
Confirm destructive actions
Deleting files, sending messages or spending money should require a human confirmation step, whatever the model.
Least privilege
Run servers with the minimum access they need. A server that renders HTML to a display does not need your home directory.

Send a prototype prompt from the chat box on the home page: no key, no account and no card needed, just the usual per-IP limits.
Read also
- What Is Model Distillation, and Why Do Claims About It Spread?
- Open-Weight Model vs Claude Haiku: Which Is Better for App Prose?
- How to Connect Open WebUI to an OpenAI-Compatible Model Endpoint
- Why Does the Same Claude Prompt Behave Differently Over Time?
- Claude Subscription vs API Key: Which Should a Builder Pay For?