ANHA in Your own agent
There are three ways in, and which one you want depends on what your program already speaks. All three reach the same tools.
Install
If your program speaks MCP
Connect to the Streamable HTTP endpoint directly. It is stateless and JSON-only, so there is no session to manage.
Authorization is OAuth 2.1 with dynamic client registration: register, send the user through the authorize step, and keep the token.
Endpointhttps://resolver.anha.ai/mcpIf your program launches subprocesses
Spawn the published bridge over stdio. It handles the whole OAuth flow itself and caches the token under ~/.anha.
All of its diagnostics go to stderr, because stdout is the MCP channel.
anha-mcp on npmstdio config{ "mcpServers": { "anha": { "command": "npx", "args": ["-y", "anha-mcp"] } } }If your program uses a model's own tool calling
Load the tool definitions as functions, then map each call onto its HTTP route.
Reads need no credential at all, which makes this the fastest way to try ANHA from any language.
Tool definitionshttps://resolver.anha.ai/tools.jsonHandle the waiting case
A merchant may require phone approval. That returns a pending status with a request id rather than a result.
Poll the invocation until it resolves. A human decision can take minutes, so do not treat pending as an error.
Test
Check the endpoint from your machine first
This read is public and needs no credential, so it separates a network problem from a client problem before you debug any code.
curl https://resolver.anha.ai/v1/resolve/@nike.aiYou should see
{"handle":"@nike.ai","addresses":[…],"capabilities":[…],"public_key":"…"}Then ask for something real
A passing check only proves the connection works. This proves the model can actually reach the tools.
“Use ANHA to resolve @nike.ai and tell me what it can do.”
Troubleshoot
- tools/list comes back empty
Cause — The request carried no token, so only the anonymous surface is visible.
Fix — Complete the OAuth flow and send the bearer token. An ungranted call answers with JSON-RPC error -32001.
- The server rejects your session header
Cause — The endpoint is stateless and JSON-only. It has no SSE stream and no session id.
Fix — Drop the session header and the SSE upgrade. GET and DELETE both answer 405 by design.
- Connecting times out, or the endpoint is unreachable
Cause — A corporate proxy or firewall is blocking the resolver.
Fix — Check the endpoint directly with curl https://resolver.anha.ai/v1/resolve/@nike.ai — a JSON record means the network is fine and the problem is in the client config. No response means ask for https://resolver.anha.ai/mcp to be allowed.
- An order or payment just hangs
Cause — This is not a fault. The merchant requires phone approval, so the call returns a pending status with a request id.
Fix — Approve it on your phone. A human decision can take minutes, and the caller polls until it lands.
Still stuck?
Every guide shares the same sign-in and the same tools, so a fix on another platform often applies here too.