DEV Community

Cover image for Give Your Agent Its Own Public IPv6 Address with Nexus SDK
Cary Chang
Cary Chang

Posted on

Give Your Agent Its Own Public IPv6 Address with Nexus SDK

Most MCP agents today are still addressed indirectly.

They live behind localhost, a host IP, and a port:

Machine A
├── Agent 1 : port 8001
├── Agent 2 : port 8002
└── Agent 3 : port 8003

Machine B
└── Agent 4 : port 9001
Enter fullscreen mode Exit fullscreen mode

This works well when an Agent runs next to its client.

But as Agents become long-running services—running across workstations, edge devices, servers, and cloud infrastructure—the abstraction starts to feel awkward.

The network knows where the machine is.

The Agent is only identified indirectly through a port and some routing configuration.

What if the Agent itself had a network address?

Agent 1 → IPv6 address A
Agent 2 → IPv6 address B
Agent 3 → IPv6 address C
Agent 4 → IPv6 address D
Enter fullscreen mode Exit fullscreen mode

That is one of the ideas behind Nexus SDK.

A supported MCP Agent can request its own public IPv6 /128, expose a standard MCP endpoint on that address, and be called directly from another machine.

In other words:

An Agent can become a first-class network endpoint, rather than just a process behind a host and port.

This tutorial shows the smallest possible example. We will create an echo tool, let Nexus SDK request an IPv6 address for the Agent, and invoke it from another terminal.

What we are building

Your terminal
    │ standard MCP over HTTP
    ▼
Agent's IPv6 address · /mcp
    │
    ▼
echo(message) → {"echo": message}
Enter fullscreen mode Exit fullscreen mode

MCP still defines how clients discover and call tools. IPv6 gives the service a network address. Nexus SDK connects those pieces and manages the Agent's address lease through a local address service.

0. Prerequisites and installation

What you need

Requirement For this tutorial
Python 3.10 or newer; 3.12 recommended.
Agent host Windows, or Linux with systemd and iproute2. This host-managed IPv6 walkthrough does not cover macOS.
Setup permissions Administrator approval on Windows or sudo on Linux to install the address service.
IPv6 network An authorized global IPv6 address source (/64 or PD-prefix) supported by the address service, with routing to the Agent host.

Windows install

python -m pip install --upgrade "nexilume[windows,fastmcp]==0.49.1"
Enter fullscreen mode Exit fullscreen mode

The windows extra installs the Windows service helpers; fastmcp installs the MCP server and command-line client dependencies.

Linux install

python -m pip install --upgrade "nexilume[fastmcp]==0.49.1"
Enter fullscreen mode Exit fullscreen mode

Check the installation

In the activated environment, run:

python -m pip check
python -c "import nexus_agent; print(nexus_agent.__version__)"
nexus-agent doctor
Enter fullscreen mode Exit fullscreen mode

You should see version 0.49.1 and a READY diagnostic.

1. Prepare the Agent Host

Initialize the address service on the Agent host, approve the Windows elevation prompt or Linux sudo request, and check its status:

nexus-agent ipv6 setup
nexus-agent ipv6 doctor
Enter fullscreen mode Exit fullscreen mode

If setup changes your group membership, sign out and back in, reactivate the environment, and rerun nexus-agent ipv6 doctor before continuing. If setup finds multiple eligible interfaces, choose the one intended for this deployment; do not select an arbitrary prefix. Setup does not create a permanent public firewall rule.

2. Write the Agent

Save this as agent.py:

from nexus_agent import NexusAgent
from nexus_agent.fastmcp import NexusMCPServer


def main():
    mcp = NexusMCPServer("My IPv6 Agent")

    @mcp.tool
    def echo(message: str) -> dict:
        """Return the caller's message without external side effects."""
        return {"echo": message}

    agent = NexusAgent.public_ipv6(
        "auto",
        agent_id="echo",
        tenant="demo",
        mcp=mcp,
        auth="none",
        port=9443,
        mcp_port=9444,
    )
    agent.run()


if __name__ == "__main__":
    main()
Enter fullscreen mode Exit fullscreen mode
  • mcp=mcp serves the MCP application, rather than treating it as an ordinary REST handler.
  • "auto" asks the configured local address service for a host-owned IPv6 /128.
  • auth="none" keeps this controlled-network demonstration free of credential setup.
  • The MCP listener uses port 9444; the separate Nexus-native Invoke listener uses 9443.
  • tenant="demo" defined a local namespace here.

Start it:

python agent.py
Enter fullscreen mode Exit fullscreen mode

The SDK prints an MCP: line containing the actual endpoint. Copy that complete URL, including the square brackets around the IPv6 address, the port, and /mcp.

Nexus public IPv6 Agent ready
Agent: agent://demo/echo
Endpoint: http://[2400:dd01:1034:1112:f560:2cfe:xxxx:9c27]:9443
MCP: http://[2400:dd01:1034:1112:f560:2cfe:xxxx:9c27]:9444/mcp
Authentication: none
Enter fullscreen mode Exit fullscreen mode

Do not use the separate Endpoint: URL for MCP calls.

3. Call it from a terminal

Open another terminal. For a remote test, use another computer with IPv6 connectivity to the Agent address and the same client dependency environment. The caller does not need to run the address-service setup.

Set MCP_URL to the exact URL printed by the Agent:

Linux / Bash:

read -r -p "Paste the Agent's MCP URL: " MCP_URL
fastmcp list "$MCP_URL"
Enter fullscreen mode Exit fullscreen mode

You should see the echo tool. Then call it:

fastmcp call "$MCP_URL" echo "message=Hello Nexus"
Enter fullscreen mode Exit fullscreen mode

Windows / PowerShell: use Read-Host instead of Bash's read:

$MCP_URL = Read-Host "Paste the Agent's MCP URL"
fastmcp list "$MCP_URL"
fastmcp call "$MCP_URL" echo "message=Hello Nexus"
Enter fullscreen mode Exit fullscreen mode

The tool result contains:

{"echo": "Hello Nexus"}
Enter fullscreen mode Exit fullscreen mode

When finished, stop the Agent with Ctrl+C.

Why give an Agent its own address?

Most software infrastructure starts with machines:

machine → service → application

For Agent systems, we think another abstraction is becoming useful:

Agent → identity → endpoint → execution environment

The Agent may move between environments.

The machine may change.

The implementation may change.

But clients should still be able to reason about the Agent as the thing they want to reach.

MCP gives us a standard interaction layer.

IPv6 gives us enough address space to make fine-grained network identities practical.

Nexus connects the two.

If FastMCP fails before connecting

An error such as FastMCP server support is not installed occurs during local imports, before a request reaches the Agent. It can indicate missing dependencies (maybe not an IPv6).

Use the clean environment above, run python -m pip check, and inspect the complete exception chain if the error remains:

python -c "from fastmcp.server.server import FastMCP"
Enter fullscreen mode Exit fullscreen mode

The earlier exception usually identifies the actual missing or incompatible component.

Try it

If the idea of making Agents first-class network endpoints sounds useful, try Nexus:

⭐ Star Nexus on GitHub and follow the project for updates.

Other resources:

Top comments (0)