Industry problems

How do AI agents talk to each other without a server?

Open agent protocols such as MCP and A2A assume an endpoint the caller can reach. MCP connects a host's client to a server over a local subprocess or HTTP, and A2A agents publish an Agent Card and talk over HTTP-based bindings. Without a server, agents on one local network can find each other with mDNS and DNS-SD, and device-to-device software can carry discovery and request-response messages between devices that share only a nearby radio link.

TL;DR

Whether AI agents need a server depends on the case. A local MCP server over stdio needs no network, A2A agents need an IP route, and a cloud model needs the internet. Agents on one network find each other with mDNS and DNS-SD, and devices with no shared network can use short-range radio. Each device then handles authorization and failures.

Learning objectives

After reading this article you will be able to:

  • Explain how MCP and A2A each assume an endpoint the caller can reach
  • Describe how mDNS and DNS-SD let agents find peers on a local network
  • Identify the authorization, confidentiality and failure jobs each device takes on without a server

Servers in MCP and A2A

In MCP and A2A, the two open protocols that describe how AI agents connect to tools and to each other, the server is something the caller can reach.

The Model Context Protocol (MCP) follows a client-host-server design. A host application creates clients, and each client talks to exactly one server. Servers expose tools, resources and prompts, and the specification says they can be local processes or remote services. Its two standard transports are stdio, where the client launches the server as a subprocess and they exchange messages over standard input and output, and Streamable HTTP, where each message is an HTTP POST to a single endpoint. The pattern is asymmetric: servers do not initiate JSON-RPC requests.

The Agent2Agent (A2A) protocol, an open project under the Linux Foundation, is built for agents to work with other agents. Each A2A server publishes an Agent Card, a JSON document describing its identity, skills, endpoint and authentication requirements. Clients find cards at a well-known HTTPS URL on the agent’s domain, through registries, or by direct configuration. The specification defines JSON-RPC, gRPC and HTTP+JSON bindings, and Agent Cards may be signed with JSON Web Signature so clients can check they have not been altered.

So “without a server” can mean three different things. A local MCP server over stdio already needs no network, because it runs on the same machine. Agents that use A2A need an IP route to each other’s endpoints. And an agent whose model runs in the cloud needs the internet for its own reasoning, whatever protocol it uses to reach other agents. When the other end is a light, a lock or a sensor rather than another agent, Can AI agents control smart home and IoT devices locally? covers the options.

Local network agent discovery with mDNS

Agents that share a local IP network but no DNS server or registry can use the same mechanism that lets computers, printers and smart TVs find each other on a home network. Multicast DNS, RFC 6762, performs DNS-like operations on the local link with no conventional DNS server, using names ending in .local. DNS-Based Service Discovery, RFC 6763, lets a client discover a list of named instances of a service type using ordinary DNS queries.

libp2p, a peer-to-peer networking stack, uses mDNS for peer discovery on the same local network without configuration. Its specification defines a DNS-SD service name, _p2p._udp.local, and peers answer a query with TXT records listing the addresses they listen on.

These methods are scoped to the local link. They need devices on the same network segment, with multicast allowed, and they say nothing about whether a discovered peer should be trusted. How do devices discover services without a server or DNS? covers the options in more detail.

Agent messaging over short-range radio

AI agents on devices with no shared network can still talk over a short-range radio such as Bluetooth Low Energy, if the devices share one. Agents can also run on phones, handhelds, vehicles and robots. Two of them can be a metre apart with no shared Wi-Fi and no internet, and every method above stops working.

Device-to-device software can carry the same three steps agents need, over that radio and across several hops:

  1. Advertise a capability, such as “I can read this equipment’s status”.
  2. Discover which nearby devices offer it.
  3. Invoke it with a request and receive a response.

Offline Protocol’s MeshServices follows this pattern: a device registers a service, others discover it and send requests across the mesh. In v0.33.0 the advertisements are signed plaintext: attributable and tamper-evident, but readable by devices that relay or overhear them. Requests and responses are sealed in the MLS session between the two devices once it is confirmed, so the devices in between cannot read them, but the first request to a provider an agent has never met still travels signed and readable. On a box running the Python service, an agent that does not use the SDK can also call a service on another device with a plain HTTP request through the HTTP front, which always carries the call inside an encrypted message.

Per-device security and failure handling

Without a server, the application on each device has to take over authorization, confidentiality and failure handling. Removing the server removes the place where policy lives in a client-server design.

  • Authorization. Discovery tells you who offers a capability, not who may use it. Each provider needs its own list of approved callers, and each caller its own list of approved providers. A digital signature proves which device sent a message; it does not prove the device is allowed to ask.
  • Confidentiality. Signing and encrypting are different properties. A signed request can still be read by every relay, and even encrypted traffic shows metadata such as timing and size.
  • Failure handling. A request with no reply does not prove the work was not done. Give each request a deadline, retry only read-only operations freely, and use an operation ID so a retried action with side effects is applied only once.

None of this replaces MCP or A2A where a server is reachable. It covers the stretch where it is not, and a design can use both paths and pick whichever is available.

Frequently asked questions

Is MCP a peer-to-peer protocol between agents?

No. MCP connects a host application's client to one server that exposes tools, resources and prompts. The server can be a local process or a remote service, but the relationship is client to server, and servers do not initiate JSON-RPC requests.

Can two agents on the same Wi-Fi find each other without a server?

Yes, if they share a local IP network and multicast works on it. Multicast DNS and DNS-Based Service Discovery let a device announce a named service and let others find it with no DNS server, and libp2p uses the same mechanism for peer discovery.

What is an A2A Agent Card?

It is a JSON document each A2A server publishes, describing its identity, skills, endpoint and authentication requirements. Clients find cards at a well-known HTTPS URL on the agent's domain, through registries, or by direct configuration, and cards may be signed with JSON Web Signature.

Does a local MCP server need a network connection?

No. With the stdio transport, the client launches the server as a subprocess and they exchange messages over standard input and output on the same machine.

Can an agent trust every peer it discovers nearby?

No. Discovery tells you who offers a capability, not who may use it, and mDNS says nothing about whether a discovered peer should be trusted. Each provider needs its own list of approved callers, and each caller its own list of approved providers.

Are Offline Protocol MeshServices requests encrypted?

Requests and responses are sealed in the MLS session between the two devices once it is confirmed, so the devices in between cannot read them. In v0.33.0 the service advertisements, and the first request to a provider an agent has never met, travel signed and readable.

Sources

Build it with Offline Protocol

The nearby service guide shows how one device advertises a capability with MeshServices and another discovers it and sends a request, including how to approve providers and handle a missing response.

Read the nearby service guide