# MCP spec

URL: /code/mcp/spec · Id: `page:code/mcp/spec`

> The server, its three tools, and how a client connects.

One server gives any MCP client every operation of every [Startup](/business/nouns/startup) its token reaches.

### Endpoint
```text
https://api.sb/mcp
```

Streamable HTTP. Clients sign in with OAuth; the token carries the caller's namespace and scopes.

### Tools
| Tool | Does |
| --- | --- |
| `search` | Finds records, Nouns, Verbs, and docs by keyword, meaning, or filter. |
| `fetch` | Returns one record, list, or definition by id or path; `/$.d.ts` returns the types of `$`. |
| `do` | Runs a short TypeScript program with the typed `$` in scope, as one Action. |

### Input schemas

**search**

```json
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "What to find."
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "default": 10
    }
  },
  "required": [
    "query"
  ]
}
```

**fetch**

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "An api.sb id or path, such as /offers/offer_1 or /$.d.ts."
    }
  },
  "required": [
    "id"
  ]
}
```

**do**

```json
{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "description": "The body of an async function. `$` is in scope; return the result."
    },
    "mode": {
      "type": "string",
      "enum": [
        "try",
        "send",
        "do"
      ],
      "description": "The Mode for every call in the program. Defaults to each Verb default."
    }
  },
  "required": [
    "code"
  ]
}
```

### The do program
`do` runs the body of an async function with `$` in scope, the same client as the SDK. One run is one Action. Fetch `/$.d.ts` first for the caller's types.

```ts
const offer = await $.Offer.publish({ offer: 'offer_1' })
return offer
```

### Connect a client

**Claude Code**

```bash
claude mcp add --transport http startup-builder https://api.sb/mcp
```

**Claude**

```text
Settings → Connectors → Add custom connector
URL: https://api.sb/mcp
```

**ChatGPT**

```text
Settings → Apps and connectors → Create
URL: https://api.sb/mcp
Authentication: OAuth
```

**Cursor**

```json
{
  "mcpServers": {
    "startup-builder": {
      "url": "https://api.sb/mcp"
    }
  }
}
```