Skip to main content

Generate

1 operation under /v1/generate/servers (GET): parameters, status codes, refusal bodies, and the same request in curl, HTTP, Python and TypeScript.

1 min read
View MarkdownEdit on GitHub

Base URL: https://api.codespar.dev

Every operation below requires a Bearer token. See Authentication.

GET /v1/generate/servers

GEThttps://api.codespar.dev/v1/generate/servers

List the project's generated servers

The MCP servers the Generate flow has persisted under the active project, newest first.

This is a summary read: the stored tool definitions, the source endpoints they came from and the generated server code are NOT in the response. tool_count is the length of the stored tool array, computed in the query.

status is draft for a server that has been onboarded but not wired into the router, routable once it has been activated, disabled when it has been soft-retired.

The write side refuses a NEW name once the project already holds 25 servers, and re-onboarding an existing name replaces it in place, so this read's 100-row cap is not the limit you will meet. Every generated server is project-scoped: a credential that resolves to no project gets 400 rather than an empty list, because an empty list would read as 'this project has none'.

Responses

StatusBodyDescription
200objectOK
400objectBad Request: the credential resolves to no project.

Response 200

FieldTypeRequiredDescription
serversarray of objectyes—
Example request
curl -X GET https://api.codespar.dev/v1/generate/servers \
  -H "Authorization: Bearer $CODESPAR_API_KEY"
GET /v1/generate/servers HTTP/1.1
Host: api.codespar.dev
Authorization: Bearer $CODESPAR_API_KEY
import os
import requests

res = requests.get(
    "https://api.codespar.dev/v1/generate/servers",
    headers={"Authorization": f"Bearer {os.environ['CODESPAR_API_KEY']}"},
)
res.raise_for_status()
data = res.json()
const res = await fetch("https://api.codespar.dev/v1/generate/servers", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.CODESPAR_API_KEY}`,
  },
});

const data = await res.json();
const result = await cs.api.get("/v1/generate/servers");
Example response 200
application/json
{
  "servers": [
    {
      "id": "obj_0000000000000000",
      "name": "Example",
      "version": "string",
      "description": "string",
      "status": "draft",
      "tool_count": 1,
      "created_at": "2026-01-15T12:00:00.000Z",
      "updated_at": "2026-01-15T12:00:00.000Z"
    }
  ]
}
Generate | CodeSpar