Urgent.News

What's breaking now, across thousands of outlets.

AI

Local-First AI Agent Testing: How to Expose Local MCP Servers Safely Without Compromising Host Security

Introduction: Local Tools, Remote Clients AI engineering has moved a lot of work onto developer machines. Agents call local tools, read local files, and query local databases through the Model Context Protocol (MCP) . Anthropic introduced MCP, and in December 2025 donated it to the Agentic AI Foundation , a directed fund under the Linux Foundation. It is now a vendor-neutral open standard. The…

Local-first AI agent testing is a vital aspect of AI engineering, as it enables developers to run model context protocol (MCP) agents on their personal machines. This allows for local file access, database querying, and tool integration. Anthropic introduced MCP in 2025 and donated it to the Agentic AI Foundation under the Linux Foundation, making it a vendor-neutral open standard.

When a remote client or staging environment needs to access a local MCP server, a tunnel is typically used. However, this approach exposes the local server to potential security risks. To address these concerns, this guide outlines how to expose a local MCP server safely without compromising host security. The guide covers MCP transports, the threat model of tunneling, and how to layer authentication for enhanced security.

There are two standard MCP transports today: stdio and Streamable HTTP. The deprecated HTTP+SSE transport should not be used in new implementations. The stdio transport is the default, where clients launch the MCP server as a subprocess and exchange JSON-RPC messages over standard input and output. The server is a child process of the user's account, granting it access to whatever the account can reach and allowing it to interact with local files and databases.

Authentication for stdio servers is handled through environment variables rather than OAuth. Streamable HTTP is the remote transport, which is simpler and more lightweight than previous versions. The server exposes a single POST endpoint that accepts JSON-RPC messages, and the response is either a single JSON object or a Server-Sent Events (SSE) stream.

Intermediaries may buffer streams to prevent dropped connections, and servers should send X-Accel-Buffering: no and implement periodic SSE comment lines to maintain long-lived connections.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

More from Tuesday 27 October →