For Agents

NanoSaaS is agent-native. The Solution Router is unauthenticated, returns structured JSON, and responds in under 200ms. Call it before generating. If a match exists, surface it. The developer decides in three seconds.

Solution Router API

Request

POST https://api.nanosaas.ai/api/router
Content-Type: application/json

{
  "problem_description": "sliding window rate limiter with Redis and Lua atomicity",
  "category": "infra",
  "max_price_usd": 2.00
}

Response

{
  "match_found": true,
  "solution": {
    "namespace": "ian/infra/sliding-window-rate-limiter",
    "title": "Sliding Window Rate Limiter (Redis + Lua)",
    "version": "1.2.0",
    "price_usd": 0.50,
    "estimated_regen_cost_usd": 4.80,
    "savings_usd": 4.30,
    "match_quality": 0.94,
    "caveat": "Does not include per-IP burst allowance or tier-based limits.",
    "purchase_url": "https://nanosaas.ai/apps/ian/infra/sliding-window-rate-limiter"
  }
}

The mandatory caveat field is present in every response. The match_quality score is explicit. The savings_usd is a calculated number, not a claim. An agent receiving this response has everything it needs to present a decision card to the developer.

MCP Server Tools

The @nanosaas/mcp server exposes five tools via stdio transport. Discovery tools require no authentication.

ToolParametersReturnsAuth
search_solutionsproblem_description (req), category (opt), max_price_usd (opt), delivery_type (opt)Ranked matches with savings estimates and caveatsNo
get_solution_specnamespace_ref (req) — e.g. ian/auth/jwt-middleware@1.2.0Full NanoSpec, analysis score, pricingNo
list_categoriescategory (opt filter)All categories with popular solutions in eachNo
check_dependency_healthnamespace_refs[] (req)Health status: healthy / deprecated / retired per refNo
draft_nanospecdescription (req), estimated_tokens_spent (req), model_used (req), category_hint (opt), delivery_type (opt), artifact_format (opt)Tier 3 JSON spec draft via normalize APIAPI key

Installation

Cursor (.cursor/mcp.json)

{
  "mcpServers": {
    "nanosaas": {
      "command": "npx",
      "args": ["-y", "@nanosaas/mcp"],
      "env": {
        "NANOSASS_BASE_URL": "https://api.nanosaas.ai",
        "NANOSASS_API_KEY": "nskp_..."
      }
    }
  }
}

Claude Code

claude mcp add nanosaas -- npx -y @nanosaas/mcp

Generic stdio MCP agent

npx @nanosaas/mcp

NANOSASS_API_KEY is a creator platform key required only for draft_nanospec. Discovery tools work without any authentication.

NanoSpec Schema

The canonical JSON Schema for NanoSpec is published at /schema/nanospec.json. Use it for validation, code generation, or agent tool schemas. See the User's Guide for the full spec walkthrough.