Connection Types for MCP Servers
MCP servers can communicate with clients using different connection protocols, each with its own advantages and use cases. This guide explains the primary connection types supported by mcp_use:Standard Input/Output (STDIO)
STDIO connections run the MCP server as a child process and communicate through standard input and output streams.Characteristics:
- Local Operation: The server runs as a child process on the same machine
- Simplicity: Easy to set up with minimal configuration
- Security: No network exposure, ideal for sensitive operations
- Performance: Low latency for local operations
Configuration Example:
HTTP Connections
HTTP connections communicate with MCP servers over standard HTTP/HTTPS protocols.Configuration Example:
Choosing the Right Connection Type
The choice of connection type depends on your specific use case:- STDIO: Best for local development, testing, and enhanced security scenarios where network exposure is a concern
- HTTP: Ideal for stateless operations, simple integrations, and when working with existing HTTP infrastructure
Using Connection Types
Connection types are automatically inferred from your configuration file based on the parameters provided: For example:- If your configuration includes
commandandargs, a local STDIO connection will be used - If your configuration has a
urlstarting withhttp://orhttps://, an HTTP connection will be used