Command-line tool for scaffolding NAIS-compliant agents.
NAIS (Network Agent Identity Standard) lets AI agents use domains as globally discoverable identities using DNS and HTTPS. This CLI generates a ready-to-deploy agent project from a single command.
npm install -g nais-cliOr use without installing:
npx nais-cli init-agent myagent.comnais init-agent <domain>nais init-agent myagent.comOutput:
Creating NAIS agent: myagent.com
Files created:
myagent.com/.well-known/agent.json
myagent.com/dns.txt
myagent.com/mcp.php
myagent.com/README.md
myagent.com/test.sh
Next steps:
1. Add DNS TXT record (see dns.txt):
_agent.myagent.com TXT "v=nais1; manifest=https://myagent.com/.well-known/agent.json; mcp=https://myagent.com/mcp.php; auth=none"
2. Deploy the files to your web server under myagent.com
3. Verify with the NAIS resolver:
curl "https://resolver.nais.id/resolve.php?domain=myagent.com"
4. Validate on the NAIS website:
https://nais.id/validate
5. Test the MCP endpoint:
curl -X POST https://myagent.com/mcp.php \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"tools/call","id":1,"params":{"name":"ping","arguments":{}}}'
| File | Purpose |
|---|---|
.well-known/agent.json |
NAIS agent manifest — identity, capabilities, auth, payment |
mcp.php |
MCP endpoint (JSON-RPC 2.0) with a starter ping tool |
dns.txt |
DNS TXT record template with field explanations |
README.md |
Deployment and testing guide for the generated agent |
test.sh |
Shell script with curl commands to test all endpoints |
- Add DNS record — Copy the TXT record from
dns.txtinto your DNS provider - Upload files — Deploy to any PHP-capable web server with HTTPS
- Verify — Run the resolver:
curl "https://resolver.nais.id/resolve.php?domain=myagent.com" - Validate — Check your agent at https://nais.id/validate
The generated agent starts with a single ping tool. To add your own:
- Add the tool to
tools/listinmcp.php - Add a handler in
handleToolsCall() - Add the capability to
.well-known/agent.json
See the NAIS specification for the full schema.
Domain
↓
DNS lookup: _agent.<domain> TXT
↓
Manifest: /.well-known/agent.json
↓
MCP endpoint: /mcp.php
The NAIS resolver automates this entire flow:
curl "https://resolver.nais.id/resolve.php?domain=myagent.com"- Node.js 16+ (for the CLI)
- PHP 7.4+ (for the generated agent)
- HTTPS-capable web server
- DNS access to add TXT records
| Resource | Link |
|---|---|
| NAIS Website | https://nais.id |
| Specification | https://nais.id/spec |
| Quickstart | https://nais.id/quickstart |
| Validator | https://nais.id/validate |
| Resolver | https://github.com/nais-standard/resolver |
| SDKs | https://github.com/nais-standard/clients |
| Examples | https://github.com/nais-standard/examples |
MIT