Custom Agent Integration
Connect any MCP-capable agent framework to Route6 over streamable HTTP.
- Lite (recommended): connect directly to the hosted gateway
https://gw.route6.me/mcpwith your API key as a Bearer token — no Docker required. - Pro: run the
route6me/netidcontainer (MCP bound to127.0.0.1:3000) and connect tohttp://localhost:3000/mcp(no auth header — the container authenticates with its baked-in key).
The examples below use the Lite gateway; for Pro, swap the URL to http://localhost:3000/mcp and drop the Authorization header.
# pip install mcp
import asyncio
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client
URL = "https://gw.route6.me/mcp"
HEADERS = {"Authorization": "Bearer sk_a6_your_key_here"}
async def main():
async with streamablehttp_client(URL, headers=HEADERS) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
print(f"Available tools: {[t.name for t in tools.tools]}")
result = await session.call_tool("identity_get", arguments={})
print(result.content[0].text)
asyncio.run(main())Never hard-code your API key — read it from an environment variable or secret store. The key grants full control of your Route6 account.