Docs

Docs

Getting Started

Two paths — pick the one that fits:

PathBest for
Scaffold with create-cpod-appNew project — get a running app in 60 seconds
🔧Manual setupAdding cPod to an existing codebase

Scaffold a New App#

One command gives you a complete, running app with OAuth auth, MCP tool registration, and example API routes:

bash
npx create-cpod-app my-app

Python/Go/.NET install via the Install the SDK commands below; the emulator is a portal toggle.

Run the scaffolder#

bash
npx create-cpod-app my-app

The guided CLI will ask:

  • Template — TypeScript (Node.js) or .NET (C#)
  • Description — a short description of your app
  • Include example MCP tool + route? — recommended yes

It generates a project in ./my-app/ with everything wired up.

Get your credentials#

You need two things before running the app:

API key — sign in at cyberpod.app/dashboard and copy your API key.

App ID — register your app once with the API:

bash
curl -X POST https://api.cyberpod.app/api/v1/apps/register \
  -H "Authorization: Bearer $CPOD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "my-app", "description": "My first cPod app"}'

Response:

json
{ "appId": "app_01abc...", "name": "my-app", ... }

Save the appId.

Configure environment#

bash
cd my-app
cp .env.example .env

Edit .env:

bash
CPOD_API_KEY=your_api_key_here
CPOD_APP_ID=app_01abc...
 
# Uncomment this to use the local emulator instead of production
# CPOD_API_URL=http://localhost:4000

Run your app#

bash
npm install
npm run dev

Verify it works#

bash
# Health check
curl http://localhost:3000/health
# {"status":"ok","timestamp":"..."}
 
# List people from cPod
curl -H "Authorization: Bearer $CPOD_API_KEY" http://localhost:3000/people
 
# Call an MCP tool through the proxy
curl -X POST http://localhost:3000/mcp/call \
  -H "Content-Type: application/json" \
  -d '{"tool":"get_person","arguments":{"id":"per-001"}}'

Local development without credentials? Uncomment CPOD_API_URL=http://localhost:4000 in your .env and start the emulator — any Bearer token works, no account needed. See Emulator guide.


What create-cpod-app generates#

TypeScript template#

code
my-app/
├── src/
│   └── index.ts          # Fastify app with people endpoint + MCP proxy route
├── package.json          # @cpod/sdk, fastify, dotenv
├── tsconfig.json
├── .env.example
└── README.md

The generated src/index.ts:

  • Creates a CpodClient from env vars via CpodClient.fromEnv()
  • Defines MCP tools and registers them on startup via client.mcp.register(tools)
  • Exposes /health, /people, and /mcp/call routes
  • Gracefully skips MCP registration if CPOD_APP_ID is not set

.NET template#

code
my-app/
├── Program.cs            # ASP.NET Minimal API with MCP registration on startup
├── MyApp.csproj          # Cpod.SDK, DotNetEnv packages
├── appsettings.json
├── .env.example
└── README.md

The generated Program.cs:

  • Registers CpodClient as a singleton via DI (CpodClient.FromEnv())
  • Defines and registers MCP tools on startup
  • Exposes /health, /people, and /mcp/call endpoints

How MCP tools work in the scaffolded app#

The generated app registers a get_person tool on startup:

TypeScript

typescript
// On startup:
await client.mcp.register([
  {
    name: 'get_person',
    endpoint: '/api/v1/people/{id}',
    method: 'GET',
    inputSchema: { ... }
  }
])

Python

python
# On startup:
await client.mcp.register([
    {
        "name": "get_person",
        "endpoint": "/api/v1/people/{id}",
        "method": "GET",
        "input_schema": { ... },
    }
])

Go

go
// On startup:
_, _ = client.Mcp.Register(ctx, []cpod.McpTool{
    {
        Name:        "get_person",
        Endpoint:    "/api/v1/people/{id}",
        Method:      "GET",
        InputSchema: map[string]any{ /* ... */ },
    },
})

.NET

csharp
// On startup:
await client.Mcp.RegisterAsync(new[]
{
    new McpTool
    {
        Name = "get_person",
        Endpoint = "/api/v1/people/{id}",
        Method = "GET",
        InputSchema = new { /* ... */ },
    },
});

Once registered, any AI agent can invoke this tool through the cPod proxy — even from outside your app:

bash
# Called by Claude, GPT-4, LangChain, or any agent
curl -X POST https://api.cyberpod.app/api/v1/mcp/call \
  -H "Authorization: Bearer $AGENT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "tool": "get_person",
    "arguments": { "id": "per-001" },
    "appId": "'$CPOD_APP_ID'"
  }'

The platform audits every call, applies PII masking if configured, and resolves secret headers — your app code never sees the raw agent request.


Manual Setup#

Adding cPod to an existing project.

Install the SDK#

bash
npm install @cpod/sdk

Set environment variables#

Local emulator (no credentials needed):

bash
export CPOD_API_URL=http://localhost:4000
export CPOD_API_KEY=dev-token

Production:

bash
export CPOD_API_URL=https://api.cyberpod.app
export CPOD_API_KEY=<bearer-token>         # from POST /api/v1/auth/token
export CPOD_APP_ID=<your-app-id>           # from POST /api/v1/apps/register

Make your first call#

typescript
import { CpodClient } from '@cpod/sdk'
 
const client = CpodClient.fromEnv()
 
const people = await client.people.persons.list({ limit: 5 })
console.log(people.items)

Environment Variables Reference#

VariableRequiredDescription
CPOD_API_KEYYesBearer token — any string for emulator, OAuth token for production
CPOD_API_URLNoAPI base URL — defaults to https://api.cyberpod.app
CPOD_APP_IDFor MCPApp ID from POST /api/v1/apps/register
CPOD_CLIENT_IDFor OAuthSame as CPOD_APP_ID — used by getAppToken()
CPOD_CLIENT_SECRETFor OAuthService account secret from credentials rotate endpoint
CPOD_BASE_URLNoAlias for CPOD_API_URL (legacy, still supported)

Never commit .env to source control. Use a secrets manager (Vault, AWS Secrets Manager, Doppler) in production.


Setup Checklist#

Local emulator

  • cd emulator && node src/index.js starts without errors
  • curl http://localhost:4000/v1/health returns {"status":"ok",...}
  • CPOD_API_URL=http://localhost:4000 and CPOD_API_KEY=dev-token are set
  • First SDK call (client.people.persons.list()) returns records from seed data

Production

  • App registered — have CPOD_APP_ID from POST /api/v1/apps/register
  • Credentials rotated — have CPOD_CLIENT_SECRET stored in secrets manager
  • POST /api/v1/auth/token returns an access_token without errors
  • CPOD_API_URL=https://api.cyberpod.app and CPOD_APP_ID set in deployment env
  • First SDK call succeeds against production

MCP tools

  • client.mcp.register(tools) completes on startup
  • POST /api/v1/mcp/call returns a result for your tool
  • Agent can reach your tool via the cPod proxy URL

What's next#

  • Authentication — register an app, get service account credentials, OAuth token exchange
  • Apps & MCP — full MCP tool reference, AI-first controls, launch checklist
  • Agent Authentication — how external agents (Claude, LangChain) call your tools
  • Emulator — full emulator reference, seed data, CI usage
  • SDK Referenceclient.mcp.* method reference for all 4 languages
  • Enterprise Data Model — all domains: people, technology, risk, projects, GRC, SOC