Connecting language models to lab, network and ops tooling

The Model Context Protocol has made it easy to expose tools to language models: a network simulation lab, a ticketing system, a database, a file share. Engineers who have built or installed an MCP server for something like a network modelling lab then face a practical choice. Should they connect it through a desktop assistant app that already speaks MCP, or wire it to a model API such as Gemini's and build the glue themselves?
This comparison is for network, infrastructure and operations people exploring AI tooling. It explains how the two approaches differ, what each is good at, the safety questions that matter when a model can change real or lab infrastructure, and how a simple text model without native tool support can still take part through a structured prompt loop.
Frequently asked questions
What is MCP?
The Model Context Protocol is an open protocol for connecting AI applications to tools and data sources. An MCP server exposes tools with names, descriptions and input schemas; an MCP host or client lets a model discover and call them.
What does a desktop assistant host do?
It runs MCP servers you configure, shows their tools to the model, asks for your approval when the model wants to call one, and passes results back. You get a working loop without writing code.
How does using a model API differ?
With an API you write the client: start or connect to the MCP server, convert its tool list into the model's function-calling format, execute calls the model requests and send back results. More work, but full control over prompts, logging and approval rules.
Does the Gemini API support tool calling?
Yes, Gemini models support function calling, and Google's SDKs have been adding conveniences for MCP. Check Google's current documentation for the exact features in the SDK you use.
Which is better for a network lab?
For exploring and ad hoc questions, a desktop host is faster to start with. For repeatable workflows, scheduled checks or team use, an API-based client you control is usually better.
Is it safe to let a model configure devices?
Only with guardrails. Start with read-only tools, require human approval for changes, run against a lab before production, and log every call. A model can misunderstand topology or apply a change to the wrong device.
Can free-ai call MCP tools?
Not through a native tools parameter. You can still build a simple loop in which the model replies with a JSON action that your code validates and executes, as shown below. It is fine for experiments, not for production automation.
Is this site connected to Google or to desktop assistant vendors?
No. It is an independent service running its own open-weight model and is not affiliated with Google or any assistant vendor.
Hosts, clients and servers in plain words
MCP splits the job into parts. The server wraps a tool, such as a lab controller's API, and describes the available actions. The host is the application the user interacts with. Inside it, a client connects to servers and relays tool lists and calls between them and the model.
Desktop assistants act as hosts out of the box. With a raw model API, your own script or service becomes the host. The model itself never talks to the server directly; it only asks the host to make a call.
Tool descriptions are prompts
The model decides which tool to call largely from its name and description. Clear, specific descriptions such as list nodes in the current lab topology lead to better choices than vague ones.
Schemas keep calls valid
Each tool declares its input schema. Hosts can reject calls that do not match, catching many mistakes before they reach your lab.
Transports in practice
MCP servers commonly run as a local process that the host starts, or as a remote service reached over HTTP. Local servers are simple for one person on one machine; remote servers suit teams, because everyone's host can reach the same lab controller with consistent permissions.
The desktop host approach
With a desktop assistant, you add the MCP server to a configuration file, restart the app and start asking questions. The host shows tool calls as they happen and typically asks for approval before running them. For exploration, this is hard to beat: you can ask which nodes are down, request a summary of a topology, or try a configuration change in a lab within minutes.
The limitations show up as usage grows. You are tied to that app's model, its conversation interface and its approval prompts. Automating a nightly check or sharing a workflow with a team is awkward when the loop lives inside a desktop window.
Good for
Interactive troubleshooting, learning what a tool server can do, and one-off questions where a person is watching every step.
Less good for
Scheduled jobs, integration with ticketing or chat systems, custom logging requirements and situations where you need a specific model.

The model API approach
Building on a model API such as Gemini's means writing a small host. It connects to the MCP server, reads the tool list, converts it to the model's function declarations, and runs the loop: send messages, receive a function call, execute it, send the result, repeat until the model answers.
This takes more effort, but you control everything: the system prompt, which tools are exposed for which task, how approvals work, what is logged and where results go. It also lets you swap models, for example using a strong model for planning changes and a cheaper one for summarising outputs.
Expose fewer tools per task
A model choosing from five relevant tools makes fewer mistakes than one choosing from fifty. Your own host can pass only the tools a workflow needs.
Approval in your own channel
Instead of a desktop dialog, approvals can go to a chat channel or ticket, which fits how operations teams already work.
Start from the SDK examples
Official MCP SDKs and model provider SDKs include example clients. Begin with one of those, connect it to a single read-only tool, and get the full loop working before adding more tools or approval logic. Small, working steps beat an ambitious design that never runs end to end.
Comparison at a glance
Both approaches use the same MCP servers, so you can start with one and move to the other. The differences are in who owns the loop.
- Setup: desktop host is configuration only; API host needs code
- Model choice: desktop host uses the app's models; API host uses any model you call
- Automation: desktop host is interactive; API host can run on schedules and triggers
- Approvals: desktop host uses built-in prompts; API host uses whatever you build
- Logging: desktop host shows calls in the app; API host logs wherever you need

Safety when tools touch infrastructure
Network and lab tools are not like a weather lookup. A wrong call can shut an interface, wipe a configuration or start an expensive simulation. Treat the model as an enthusiastic junior colleague: helpful, fast and capable of confident mistakes.
Start every integration with read-only tools. Add write tools one at a time, each behind human approval, and only after you have watched the model use the read-only ones sensibly.
Finally, agree in advance what happens when the model proposes something surprising. A clear rule such as reject and ask a person keeps an odd suggestion from turning into an outage.
Lab first, always
Run new workflows against a simulated lab before any production device. A modelling lab exists precisely so that mistakes are cheap.
Log every call
Record the tool name, arguments, result and who approved it. When something changes unexpectedly, that log is the first place to look.
Keep credentials out of prompts
The MCP server should hold device credentials. The model sees tool names and results, never passwords or keys.
A structured loop for models without native tools
Not every model or endpoint supports a native tools parameter. You can still let such a model drive tools by asking it to reply with a JSON action from a list you provide, validating that action in code and executing it yourself. It is less robust than native function calling, but it is transparent and works with any chat API.
The sketch below uses the keyless endpoint on this site with two read-only actions. In a real host, the run_tool function would call your MCP client.
Validate before executing
Check that the tool name is on your allow-list and the arguments match the expected shape. Never pass model output straight into a shell or device command.
import json
from openai import OpenAI
client = OpenAI(base_url="https://api.apifreegemini.com/v1", api_key="none")
TOOLS = {
"list_nodes": "List lab nodes with their state. Args: {}",
"node_config": "Show the running config of one node. Args: {\"node\": str}",
}
SYSTEM = ("You can use these read-only tools:\n" +
"\n".join(f"- {k}: {v}" for k, v in TOOLS.items()) +
'\nReply ONLY with JSON: {"tool": name, "args": {...}} or {"answer": text}.')
def run_tool(name, args): # replace with a real MCP client call
fake = {"list_nodes": [{"node": "r1", "state": "up"}, {"node": "r2", "state": "down"}]}
return fake.get(name, {"error": "not available in this demo"})
messages = [{"role": "system", "content": SYSTEM},
{"role": "user", "content": "Which lab nodes are down?"}]
for _ in range(4):
reply = client.chat.completions.create(model="free-ai", messages=messages,
temperature=0, max_tokens=300).choices[0].message.content
messages.append({"role": "assistant", "content": reply})
try:
step = json.loads(reply.strip().strip("`").removeprefix("json"))
except json.JSONDecodeError:
print(reply); break
if "answer" in step:
print(step["answer"]); break
if step.get("tool") not in TOOLS:
print("refused unknown tool", step); break
result = run_tool(step["tool"], step.get("args", {}))
messages.append({"role": "user", "content": "Tool result: " + json.dumps(result)})
Choosing a model for tool work
Tool use rewards models that follow formats precisely and reason about multi-step plans. Strong commercial models with native function calling, Gemini included, are generally more reliable here, especially for plans that span many calls. A mid-size open-weight model can handle short, read-only lookups and summaries of tool output well.
A practical split is to let a strong model plan and propose changes, and a cheaper model summarise logs and outputs. The article on reasoning mode covers when extra thinking helps multi-step plans, and the open-weight comparison discusses where mid-size models hold up.
Test prompts against the lab
Write a handful of standard questions, such as which interfaces are down or what changed since yesterday, and run them after every change to tool descriptions or models. If an answer degrades, you know which change caused it.
Where the keyless endpoint fits
APIFreeGemini is not affiliated with Google, and its free-ai model is an independent open-weight model of about 35B parameters, not Gemini. It does not advertise native tool calling, so it fits the structured JSON loop above rather than a full MCP host. That makes it a free sandbox for learning how tool loops behave, writing validators and testing tool descriptions before connecting a paid model.
Its limits matter for tool loops in particular: each step is a request, and the endpoint allows one request per second per IP and two in parallel, with a 32,000-token context. Tool results can be large, so trim them before sending them back. For anything that changes real infrastructure, use a model and host you have tested thoroughly, with approvals and logs in place.
Whichever model you pick, write down which tools each workflow may use and who approves changes. That short policy is more important than the choice between a desktop host and your own client, and it makes the setup understandable to colleagues who join later.
Trim tool output
Device configs and logs can run to thousands of lines. Filter to the relevant section or summarise in code before passing results to the model, which saves context and improves answers.

Send a test prompt to the keyless free-ai endpoint from the home page, no sign-up or key required.
Read also
- How to route prompts between a cheap model and a strong one
- How to add a free AI step to n8n or Apple Shortcuts without a key
- Open-weight models vs Gemini: when is a mid-size model good enough?
- How to move your chat context between ChatGPT, Gemini and an API
- When is it worth switching on thinking or reasoning mode in an API?