Skip to content

nais-standard/examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

NAIS Examples

Example implementations and integration patterns for the NAIS standard.

Weather Agent Demo

The weatheragent/ directory contains a complete, working NAIS agent deployed at weatheragent.nais.id. This is the reference demo for the standard.

What's Included

weatheragent/
├── .well-known/
│   └── agent.json     # NAIS manifest
├── mcp.php            # JSON-RPC 2.0 MCP endpoint
└── .htaccess          # Apache routing

DNS Record

_agent.weatheragent.nais.id  TXT  "v=nais1; manifest=https://weatheragent.nais.id/.well-known/agent.json; mcp=https://weatheragent.nais.id/mcp; auth=wallet; pay=x402"

MCP Capabilities

The demo agent exposes 4 tools via MCP:

Tool Description
forecast Multi-day weather forecast (1-10 days)
current Real-time current conditions
historical Past weather data
alerts Severe weather alerts

Try It

# Resolve the agent
curl "https://resolver.nais.id/resolve.php?domain=weatheragent.nais.id"

# Fetch the manifest
curl "https://weatheragent.nais.id/.well-known/agent.json"

# Call the MCP endpoint
curl -X POST "https://weatheragent.nais.id/mcp" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/list","id":1}'

Using the SDK

from nais import resolve

agent = resolve("weatheragent.nais.id")
print(agent["resolved"]["mcp_endpoint"])
# https://weatheragent.nais.id/mcp

What This Proves

  • DNS-based agent discovery works end-to-end
  • The manifest schema is practical and complete
  • MCP endpoints are discoverable through NAIS
  • The resolver correctly parses and validates real records
  • Auth and payment fields are cleanly expressed

Related

  • spec — Protocol specification
  • resolver — Reference resolver
  • clients — SDKs for integration

About

Example implementations and integration patterns for NAIS including resolver responses, wallet authentication flows, and agent discovery.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages