How ruvnet/agent-name-service works
Project type and purpose
• This is a Node.js/TypeScript–based backend service and library (an open-source tool) implementing the OWASP GenAI ANS protocol.
• Its purpose is to provide a secure, modular registry for AI agents: registration, certificate management, discovery (A2A & MCP), plus integrated threat modeling via Mastra.ai.
File structure
• src/
– ans.ts: entry point for AgentNamingService (register, resolve, generateMCP)
– certificate.ts: X.509 certificate issuance & validation
– database/: DB factory & interface for SQLite persistence
– protocol/: formatting for A2A agent cards & MCP manifests
– mastra.ts & mastra-simple.ts: full vs. fallback threat analysis
– types/: TypeScript definitions
• tests/: unit & integration tests covering each service
• examples/: client-side usage scripts demonstrating registration, resolution, manifest generation
• scripts/: shell workflows to automate registrations & security workflows
• sparc-agent/: a companion client library implementing MAS-TRAC agents and workflows
• docs/architecture/: high-level design and deployment guides
• package.json, tsconfig.json, Jest config, .env support
Additional insights from the README
• Describes four core sub-systems: Agent Registry (DB), Certificate Service, Protocol Formatters, Threat Modeling
• Supports environment-driven configuration for CA info, DB path, Mastra endpoint, feature flags
• Emphasizes modular separation of concerns and plug-in–style integration of Mastra.ai