# Transports: stdio and HTTP — Agent Frameworks and MCP Basics

Source: https://www.geekswithgeeks.com/en/agent-frameworks-mcp/srv-transports

> Choose between a local stdio server and a remote streamable HTTP server.

## Local or remote

**stdio** runs the server as a child process of the host and talks over standard input and output: simple, local, one user, no network. **Streamable HTTP** runs the server as a web service that many clients can reach, which needs authentication, TLS and careful deployment. Use stdio for personal tools and HTTP for shared ones.

## Switching the transport

The tools stay the same; only the last line changes. Option names can differ between SDK versions, so check the docs for yours.

```python
# local: the host launches this process
mcp.run()

# remote: serve over HTTP
mcp.run(transport="streamable-http")
```

## Bind HTTP servers carefully

For local testing bind to `127.0.0.1`, not `0.0.0.0`. A remote server without authentication lets anyone on the network run your tools.

**Quiz:** Which transport suits a personal tool launched by your desktop app?

- [x] stdio
- [ ] Public HTTP without authentication
- [ ] FTP
- [ ] Email

*Answer:* stdio. stdio is simple and keeps the server local to the host.
