{"slug": "stdio-and-http-for-mcp-servers", "title": "Stdio and HTTP for MCP Servers", "summary": "The developer rewrote their MCP server to use Stdio input and output instead of HTTP, reducing code from 300 lines to about 60 lines using the Rust crate RMcp. The Stdio MCP server functions as a console program, and support was recently added to llama-cpp, allowing MCP server tools to appear as built-in tools in its web UI.", "body_md": "I rewrote my **MCP server** to use **Stdio** input and output instead of HTTP. An MCP server that uses Stdio still receives and returns JSON-formatted messages, but no HTTP connection is made. Instead, a client (like `llama-cpp`\n\n) uses a sub-process to interact with the MCP server.\n\nIn this sense, a Stdio MCP server is not a real \"server\" but is just a regular **console program**. In any case, I used the Rust crate `RMcp`\n\n, which allowed me to replace 300 lines of code with about 60 lines of code.\n\nWith `RMcp`\n\n, it is possible to generate most of the necessary code with just Rust **derive** attributes.\n\nIn `llama-cpp`\n\n, Stdio MCP server support was added just **a couple days ago**. To add an Stdio MCP server, use the `mcp-servers-json`\n\nor `mcp-servers-config`\n\narguments to `llama-server`\n\n, and specify a JSON object that defines `mcpServers`\n\n. This is the mcp.json file format. The MCP server tools will appear in the **built-in tools** in `llama-cpp`\n\n's web UI.", "url": "https://wpnews.pro/news/stdio-and-http-for-mcp-servers", "canonical_source": "https://www.dotnetperls.com/2026_7_27_stdio-http-mcp-servers", "published_at": "2026-07-27 07:00:00+00:00", "updated_at": "2026-07-27 14:36:46.268215+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["MCP server", "RMcp", "llama-cpp"], "alternates": {"html": "https://wpnews.pro/news/stdio-and-http-for-mcp-servers", "markdown": "https://wpnews.pro/news/stdio-and-http-for-mcp-servers.md", "text": "https://wpnews.pro/news/stdio-and-http-for-mcp-servers.txt", "jsonld": "https://wpnews.pro/news/stdio-and-http-for-mcp-servers.jsonld"}}