MCP, CLI, or REST? How to Give AI Agents Access to Your Service
Published November 16, 2026 · By Port OS Team
Should AI agents reach your service through MCP, a CLI or a REST API? Each is good at different things, so our recommendation is to offer all three and optimize each for what it does best.
TL;DR
- MCP: agents without a computer, typed schemas, in-chat UI, approvals and events.
- CLI: persistent connections, live video, pipes and scripts.
- REST: a universal fallback, with support for big files, WebRTC, multipart form handling and other complex transfers.
Table of contents
- What are MCP, CLI and REST?
- How Port OS uses all three
- A side by side comparison table of MCP vs CLI vs REST
- A side by side comparison of different agents
- FAQ
What are MCP, CLI and REST?
What is MCP?
The Model Context Protocol is an open protocol for connecting agents to tools. A service runs an MCP server that describes its tools with typed schemas, and agents discover and call them.
MCP runs two types of servers:
- Remote servers run over HTTP, so the agent needs no computer.
- Local servers run on the agent's machine over stdio.
What is a CLI?
An executable on the agent's machine, called like any shell command. For example sed, grep, etc.
What is a REST API?
A standard programmable interface that any agent or program can call.
MCP vs CLI vs REST: trade-offs in practice
- MCP streams responses but can't carry bidirectional video.
- CLIs handle bidirectional streams, but weaker models struggle with free-form output, where MCP's typed responses help.
- REST works everywhere but has no push channel: you add webhooks, SSE or polling yourself.
Different agents are best with MCP, CLI, REST
Where the agent runs matters too.
- Agents on persistent machines, like OpenClaw, can hold connections open for long times, so they can run CLIs and maintain event connections and sessions.
- Cloud agents in VMs that freeze when idle can't maintain sessions, so they need webhook style solutions to trigger reinstantiation.
- Chat products like ChatGPT may have no computer at all. There MCP's built in system for custom UI and its support for human in the loop win, since they help showcase the functionality best.
How Port OS uses all three
Port OS gives AI agents a body by letting them control smart home devices.
The way to use these devices best differs because of different abilities.
- CLI: the Port OS CLI is used for video capture (snapshots, editing footage, two-way audio) and persistent sessions like Roborock remote control or Ring PTZ, where the CLI keeps the connection alive. You can't do this type of thing over MCP, for example.
- MCP notifications: they let services like ChatGPT or Claude know when a motion event triggers on your camera, so you can keep ChatGPT on your phone and have it be notified when things happen. See how to use event subscriptions.
- MCP in ChatGPT and Claude: shows nice UX and gets confirmation feedback from customers. Sometimes customers want to see where the vacuum is on their home map, or we need a confirmation PIN from the customer when they're setting a door lock PIN. MCP has that built in via MCP apps and elicitation, which gives the user a nice UX for all their devices in one place. Connect it from ChatGPT or Claude, and see the MCP reference.
- REST: works for most of the same operations that we have in the CLI and MCP, but much lower level. Customers must manage WebRTC/SRTP connections themselves for example, or have to figure out their own mapping UX and design for Port OS's map GeoJSON. See the REST API guide and the API reference.
Conclusion: no interface supports all functions
No single interface covers everything an agent might need. Expose all of them in the long term, but pick and choose which one you want to expose as your API evolves.
To decide, start from two questions:
- What data do you serve, and how is it best exposed?
- Where do your agents run, and what does the agent support?
Appendix A: MCP vs CLI vs REST
Access and setup
| Capability | MCP | CLI | REST | Example |
|---|---|---|---|---|
| OAuth | ✓ | ✓ | ✓ | "Let me sign in." |
| Client registration (DCR/CIMD) | ✓ | ✓ | ✓ | "Register my website with this service." |
| Works without a VM | ✓ (remote servers) | ✓ | Using the service from ChatGPT |
Data and media
| Capability | MCP | CLI | REST | Example |
|---|---|---|---|---|
| Multimedia data | ✓ | ✓ | ✓ | "What's playing in the background?" |
| Large file transfers | ✓ | ✓ | "Download that game for me." | |
| Client-side caching with custom TTLs | ✓ | ✓ | ✓ (HTTP caching) | Keep a client-side cache of the tool list |
Streaming and connections
| Capability | MCP | CLI | REST | Example |
|---|---|---|---|---|
| Streaming responses | ✓ | ✓ | Limited* | A long tool call returns partial results as they arrive |
| Multiple response streams on one connection | ✓ | ✓ | Limited* | Run several tool calls and stream each result |
| Bidirectional streaming | ✓ | Live video view and capture | ||
| Persistent sessions and connections | ✓ | Keep the remote viewing session active | ||
| Stream processing | ✓ | Parse an event stream and filter out duplicates or hysteresis |
*REST can stream (SSE, HTTP/2), but most agents' HTTP tools wait for the full response.
Events and long-running work
| Capability | MCP | CLI | REST | Example |
|---|---|---|---|---|
| Push notifications to a serverless endpoint | ✓ (extension) | Custom webhooks | Notify my webserver when the camera sees motion | |
| Subscriptions for a connected client | ✓ | ✓ | Polling or SSE | Tell my running agent when the camera sees motion |
| Long-running jobs with progress | ✓ | ✓ | ✓ | "Start the oven and tell me when it's done." |
Agent ergonomics
| Capability | MCP | CLI | REST | Example |
|---|---|---|---|---|
| Typed input/output schemas the model sees directly | ✓ | Force queries to use the query API's language | ||
| Embedded user interfaces | ✓ | "Show me the Roborock map in ChatGPT." | ||
| Human-in-the-loop approval | ✓ | Confirm with the user before acting | ||
| Parallel or batched calls | ✓ | ✓ | ✓ | "Turn off the living room lights, lower the thermostat and play some music." |
| Piping output to other tools | ✓ | Capture the camera and send clips to Google Drive whenever something happens | ||
| Chainable in a script | ✓ | ✓ | Write a small script that makes the call and acts on the result |
Cost and reliability
| Capability | MCP | CLI | REST | Example |
|---|---|---|---|---|
| Low token overhead per task | Varies† | ✓ | Varies | A one-line command vs. a full tool catalog in context |
| Model already knows the interface | ✓ (popular CLIs) | ✓ (popular APIs) | git, gh, kubectl are in training data | |
| Usable on tools the model has never seen | ✓ | Limited | Limited | Typed schemas vs. repeated --help calls or reading docs |
| Structured errors the model can recover from | ✓ | Limited | ✓ | Validation error returned as a tool result vs. free-text stderr |
†Early MCP clients loaded every tool definition up front (Firecrawl). Many now load them lazily (Checkly), and Smithery found MCP cheaper than a CLI on GitHub API calls (Nordic APIs). Measure your own tools.
Security and governance
| Capability | MCP | CLI | REST | Example |
|---|---|---|---|---|
| Standard sign-in the agent client handles | ✓ | Sign in once in ChatGPT; the client manages tokens | ||
| Credentials kept off the agent's machine | ✓ (remote servers) | Depends on agent | The agent never holds the door-lock token | |
| Runs without shell access on the agent's machine | ✓ (remote servers) | ✓ | A prompt-injected agent can't run arbitrary commands through it | |
| Service-initiated user confirmation | ✓ | "Confirm before unlocking the front door" | ||
| Per-user scoped permissions | ✓ | ✓ | ✓ | A guest's agent can see cameras but not unlock doors |
Appendix B: Agent support
Support as of November 2026.
| Feature | Dots | ChatGPT | Muse | OpenClaw | Hermes | Grok | Claude | Claude Code |
|---|---|---|---|---|---|---|---|---|
| Runs in a cloud VM | ✓ | ✓ | ✓ | |||||
| Runs on a persistent machine | ✓ | ✓ | ✓ | |||||
| Runs as a VM-less chat | ✓ | ✓ | ||||||
| MCP | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
| CLI | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ||
| REST API (with auth) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ||
| MCP apps | ✓ | ✓ | ||||||
| MCP elicitation | ✓ | ✓ | ||||||
| Events/subscriptions | ✓ |
Appendix C: FAQ
Why not just have the agent use the customer's web UI and computer use?
Generally, agents can use web UIs, but they're not efficient interfaces in terms of token use, and oftentimes the same UI ends up sharing the same permissions as the customer, which is insecure and dangerous, i.e. buying things on behalf of the customer.
Can ChatGPT and other chat-based agents use a CLI?
Only if they have a computer. Chat-only products like ChatGPT can use remote MCP servers or REST.
Which interface is best for live video and other bidirectional streams?
A CLI. Neither MCP nor REST carries bidirectional video, and a CLI can also keep sessions alive, like Roborock remote control.
How can an AI agent receive events and notifications from a service?
MCP notifies connected clients, and extensions push to serverless endpoints. REST needs webhooks, SSE or polling. A CLI can surface events locally, for example as file writes.
Can MCP ask the user for approval before an agent acts?
Yes, through elicitation, for example before unlocking a door. With a CLI or REST, approval depends on the agent's own permission prompts.
References
- MCP vs CLI for AI Agents (Firecrawl)
- MCP vs. CLI: Which Is Better for Agentic AI? (Nordic APIs)
- CLIs are more token-efficient than MCP. Or are they? (Checkly)
- MCP vs CLI Tools: Why Security Changes the Answer (Stacklok)
- MCP vs CLI for AI Agents: When Each One Wins (StackOne)