Skip to content

nais-standard/nais-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

NAIS CLI

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.

Install

npm install -g nais-cli

Or use without installing:

npx nais-cli init-agent myagent.com

Usage

nais init-agent <domain>

Example

nais init-agent myagent.com

Output:

  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":{}}}'

What It Generates

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

Deploy

  1. Add DNS record — Copy the TXT record from dns.txt into your DNS provider
  2. Upload files — Deploy to any PHP-capable web server with HTTPS
  3. Verify — Run the resolver: curl "https://resolver.nais.id/resolve.php?domain=myagent.com"
  4. Validate — Check your agent at https://nais.id/validate

Adding Capabilities

The generated agent starts with a single ping tool. To add your own:

  1. Add the tool to tools/list in mcp.php
  2. Add a handler in handleToolsCall()
  3. Add the capability to .well-known/agent.json

See the NAIS specification for the full schema.

How NAIS Discovery Works

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"

Requirements

  • Node.js 16+ (for the CLI)
  • PHP 7.4+ (for the generated agent)
  • HTTPS-capable web server
  • DNS access to add TXT records

Related

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

License

MIT

About

CLI tool for scaffolding NAIS-compliant agents

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors