Skip to content
CADCAMFUN
Docs

Documentation

MCP configuration

MCP connection configuration CRUD and server-info requests.

Playground

Send these requests to your own running sidecar. Values stay in this browser.

Not connected
How this works

The sidecar listens on a loopback port chosen at startup and prints it in its ready line; use that URL and the CADCAMFUN_TOKEN it was started with. Requests go straight from this page to that address.

The sidecar sends CORS headers only to the Tauri origins and to http://localhost or http://127.0.0.1 on any port. From the hosted docs the browser blocks the response, so run the docs locally (bun run dev in packages/web) to use the playground, or copy the request as curl. To experiment without touching real data, start the sidecar with CADCAMFUN_DATA_DIR pointed at a throwaway directory — see the API walkthrough.

Operations

8 endpoints in the mcp group, generated from the sidecar's own OpenAPI document. Protected operations take Authorization: Bearer $CADCAMFUN_TOKEN; see authentication. Behaviour and limits are in the subsystem guide.

get /api/mcp/config mcp.listConfig
post /api/mcp/config mcp.createConfig
put /api/mcp/config mcp.updateConfig
delete /api/mcp/config mcp.removeConfig
get /api/mcp/config/{id} mcp.getConfig
put /api/mcp/config/{id} mcp.updateConfigById
delete /api/mcp/config/{id} mcp.removeConfigById
post /api/mcp/server-info mcp.serverInfo
MCP configuration operations in 3D Drag to orbit · scroll to zoom · right-drag to pan
One block per operation (8), stacked per resource section of this page and coloured by method: green GET, orange POST, blue PUT, violet PATCH, red DELETE. Generated from the OpenAPI document at build time.

/api/mcp/config

get /api/mcp/config # mcp.listConfig

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
source query string | null optional
Responses
200 object | object application/json
{
  success: true
  source: "claude" | "database"
  servers: Array<{
    id: string
    name: string
    type: string
    url: string | null
    command: string | null
    args: unknown
    workingDirectory: string | null
    enabled: boolean
    userId: string | null
    createdAt: string
    updatedAt: string
  }>
  count: number | "Infinity" | "-Infinity" | "NaN"
} | {
  success: true
  source: "file"
  config: {
    mcpServers: Array<{
      id: string
      name: string
      type: string
      url: string | null
      command: string | null
      args: unknown
      workingDirectory: string | null
      enabled: boolean
    }>
  }
  exportedAt: string
}
400 McpEnvBadRequestEncoded application/json
McpEnvBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 McpEnvInternalEncoded application/json
McpEnvInternalEncoded
Example response captured · 200
GET /api/mcp/config
{
  "success": true,
  "source": "claude",
  "servers": [],
  "count": 0
}
SDK example
mcp.listConfig
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// McpListConfigInput
const result = await client.mcp.listConfig({})
curl
GET /api/mcp/config
curl --request GET "${CADCAMFUN_URL}/api/mcp/config" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Try it
post /api/mcp/config # mcp.createConfig

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
source query string | null optional
Request body · required · application/json
{
  id?: string | null
  name?: string | null
  type?: string | null
  url?: string | null
  command?: string | null
  args?: unknown | null
  workingDirectory?: string | null
  defaultWorkingDirectory?: string | null
  enabled?: boolean | null
  serverName?: string | null
  testConnection?: boolean | null
  mcpServers?: unknown | null
  tool_configuration?: unknown | null
  authorization_token?: string | null
}
Responses
200 object application/json
{
  success: true
  source: "file"
  imported: number | "Infinity" | "-Infinity" | "NaN"
  message: string
}
201 object application/json
{
  success: true
  source: "claude" | "database"
  server: {
    id: string
    name: string
    type: string
    url: string | null
    command: string | null
    args: unknown
    workingDirectory: string | null
    enabled: boolean
    userId: string | null
    createdAt: string
    updatedAt: string
  }
  connectionTest?: unknown | null
  message: string
}
400 McpEnvBadRequestEncoded application/json
McpEnvBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
500 McpEnvInternalEncoded application/json
McpEnvInternalEncoded
fetch example
mcp.createConfig
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/mcp/config`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
curl
POST /api/mcp/config
curl --request POST "${CADCAMFUN_URL}/api/mcp/config" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Try it
put /api/mcp/config # mcp.updateConfig

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
source query string | null optional
Request body · required · application/json
{
  id?: string | null
  name?: string | null
  type?: string | null
  url?: string | null
  command?: string | null
  args?: unknown | null
  workingDirectory?: string | null
  defaultWorkingDirectory?: string | null
  enabled?: boolean | null
  serverName?: string | null
  testConnection?: boolean | null
  mcpServers?: unknown | null
  tool_configuration?: unknown | null
  authorization_token?: string | null
}
Responses
200 object application/json
{
  success: true
  source: "claude"
  server: {
    id: string
    name: string
    type: string
    url: string | null
    command: string | null
    args: unknown
    workingDirectory: string | null
    enabled: boolean
    userId: string | null
    createdAt: string
    updatedAt: string
  }
  message: string
}
400 McpEnvBadRequestEncoded application/json
McpEnvBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 McpEnvNotFoundEncoded application/json
McpEnvNotFoundEncoded
405 McpEnvMethodNotAllowedEncoded application/json
McpEnvMethodNotAllowedEncoded
500 McpEnvInternalEncoded application/json
McpEnvInternalEncoded
SDK example
mcp.updateConfig
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// McpUpdateConfigInput
const result = await client.mcp.updateConfig({
  id: "",
  name: "",
  type: "",
  url: "",
  command: "",
  args: null,
  workingDirectory: "",
  defaultWorkingDirectory: "",
  enabled: false,
  serverName: "",
  testConnection: false,
  mcpServers: null,
  tool_configuration: null,
  authorization_token: ""
})
curl
PUT /api/mcp/config
curl --request PUT "${CADCAMFUN_URL}/api/mcp/config" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Try it
delete /api/mcp/config # mcp.removeConfig

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
source query string | null optional
name query string | null optional
Responses
200 object application/json
{
  success: true
  source: "claude"
  message: string
  note: string
}
400 McpEnvBadRequestEncoded application/json
McpEnvBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 McpEnvNotFoundEncoded application/json
McpEnvNotFoundEncoded
405 McpEnvMethodNotAllowedEncoded application/json
McpEnvMethodNotAllowedEncoded
500 McpEnvInternalEncoded application/json
McpEnvInternalEncoded
SDK example
mcp.removeConfig
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// McpRemoveConfigInput
const result = await client.mcp.removeConfig({})
curl
DELETE /api/mcp/config
curl --request DELETE "${CADCAMFUN_URL}/api/mcp/config" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Try it
get /api/mcp/config/{id} # mcp.getConfig

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
id path string required
Responses
200 object application/json
{
  id: string
  name: string
  type: string
  url: string | null
  command: string | null
  args: unknown
  workingDirectory: string | null
  enabled: boolean
  userId: string | null
  createdAt: string
  updatedAt: string
}
400 McpBadRequestEncoded application/json
McpBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 McpNotFoundEncoded application/json
McpNotFoundEncoded
500 McpInternalEncoded application/json
McpInternalEncoded
SDK example
mcp.getConfig
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// McpGetConfigInput
const result = await client.mcp.getConfig({
  id: "<id>"
})
curl
GET /api/mcp/config/{id}
curl --request GET "${CADCAMFUN_URL}/api/mcp/config/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Try it
put /api/mcp/config/{id} # mcp.updateConfigById

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
id path string required
Request body · required · application/json
{
  id?: string | null
  name?: string | null
  type?: string | null
  url?: string | null
  command?: string | null
  args?: unknown | null
  workingDirectory?: string | null
  defaultWorkingDirectory?: string | null
  enabled?: boolean | null
  serverName?: string | null
  testConnection?: boolean | null
  mcpServers?: unknown | null
  tool_configuration?: unknown | null
  authorization_token?: string | null
}
Responses
200 object application/json
{
  id: string
  name: string
  type: string
  url: string | null
  command: string | null
  args: unknown
  workingDirectory: string | null
  enabled: boolean
  userId: string | null
  createdAt: string
  updatedAt: string
}
400 McpBadRequestEncoded application/json
McpBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 McpNotFoundEncoded application/json
McpNotFoundEncoded
405 McpMethodNotAllowedEncoded application/json
McpMethodNotAllowedEncoded
500 McpInternalEncoded application/json
McpInternalEncoded
fetch example
mcp.updateConfigById
// Not generated in the Promise SDK (multipart, binary or raw body): call it with fetch.
const response = await fetch(`${process.env.CADCAMFUN_URL}/api/mcp/config/${id}`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})
curl
PUT /api/mcp/config/{id}
curl --request PUT "${CADCAMFUN_URL}/api/mcp/config/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Try it
delete /api/mcp/config/{id} # mcp.removeConfigById

Requires Authorization: Bearer <token>.

Parameters
NameInTypeRequired
id path string required
Responses
204 <No Content>
400 McpBadRequestEncoded application/json
McpBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 McpNotFoundEncoded application/json
McpNotFoundEncoded
405 McpMethodNotAllowedEncoded application/json
McpMethodNotAllowedEncoded
500 McpInternalEncoded application/json
McpInternalEncoded
SDK example
mcp.removeConfigById
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// McpRemoveConfigByIdInput
const result = await client.mcp.removeConfigById({
  id: "<id>"
})
curl
DELETE /api/mcp/config/{id}
curl --request DELETE "${CADCAMFUN_URL}/api/mcp/config/<id>" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}"
Try it

/api/mcp/server-info

post /api/mcp/server-info # mcp.serverInfo

Requires Authorization: Bearer <token>.

Request body · required · application/json
{
  serverId?: string | null
}
Responses
200 object application/json
{
  name: string
  version?: string | null
  instructions?: string | null
  resources?: Array<{
    name: string
    uriTemplate?: string | null
    description?: string | null
    arguments?: Array<{
      name: string
      description?: string | null
      required?: boolean | null
    }> | null
  }> | null
  tools?: Array<{
    name: string
    description?: string | null
    parameters?: unknown | null
  }> | null
}
400 McpBadRequestEncoded application/json
McpBadRequestEncoded
401 UnauthorizedEncoded application/json
UnauthorizedEncoded
404 McpNotFoundEncoded application/json
McpNotFoundEncoded
405 McpMethodNotAllowedEncoded application/json
McpMethodNotAllowedEncoded
500 McpInternalEncoded application/json
McpInternalEncoded
SDK example
mcp.serverInfo
import { CadCam } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

// McpServerInfoInput
const result = await client.mcp.serverInfo({
  serverId: ""
})
curl
POST /api/mcp/server-info
curl --request POST "${CADCAMFUN_URL}/api/mcp/server-info" \
  --header "Authorization: Bearer ${CADCAMFUN_TOKEN}" \
  --header "Content-Type: application/json" \
  --data-binary @request.json
Try it

Schemas

Named schemas reachable from this group's parameters, bodies and responses. A ? marks an optional field; | null marks a field that may be present with a null value.

McpBadRequestEncoded
{
  _tag: "McpBadRequest"
  error: string
}
McpEnvBadRequestEncoded
{
  _tag: "McpEnvBadRequest"
  success: false
  error: string
}
McpEnvInternalEncoded
{
  _tag: "McpEnvInternal"
  success: false
  error: string
}
McpEnvMethodNotAllowedEncoded
{
  _tag: "McpEnvMethodNotAllowed"
  success: false
  error: string
}
McpEnvNotFoundEncoded
{
  _tag: "McpEnvNotFound"
  success: false
  error: string
}
McpInternalEncoded
{
  _tag: "McpInternal"
  error: string
}
McpMethodNotAllowedEncoded
{
  _tag: "McpMethodNotAllowed"
  error: string
}
McpNotFoundEncoded
{
  _tag: "McpNotFound"
  error: string
}
UnauthorizedEncoded
{
  _tag: "Unauthorized"
  message: string
}

Calling this group

Operation ids have the form mcp.<name>. The generated Promise SDK (@cadcamfun/api/sdk) exposes most of them as client.<namespace>.<method>(input), where input is one flat object of path parameters and body fields; each card's SDK example shows the exact accessor and input type. Multipart uploads, binary or JavaScript responses and raw webhooks are not generated; those cards show fetch instead.

Errors from the Promise SDK
import { CadCam, ClientError } from "@cadcamfun/api/sdk"

const client = CadCam.make({
  baseUrl: process.env.CADCAMFUN_URL!,
  headers: { authorization: `Bearer ${process.env.CADCAMFUN_TOKEN}` },
})

try {
  await client.projects.list()
} catch (error) {
  if (error instanceof ClientError) {
    // Transport | UnexpectedStatus | UnsupportedContentType | MalformedResponse | SseEventTooLarge
  } else {
    // a declared error body: switch on error._tag
  }
}

Troubleshooting

SymptomLikely causeFix
401 on every callToken from a previous launch, or missing Bearer prefixSend Authorization: Bearer <token> with the token the sidecar was started with.
400 before anything happensBody or parameter does not match the schemaCompare the payload with the request schema on the card.
403 or 404 on a record you can see elsewhereThe acting account differsSend the right x-session-token, or use the local profile that owns the record.
409Conflicting state, such as a duplicate name or a stale branch headRe-read the resource and retry with current data.
Try it says "blocked by CORS"The docs are served from a non-loopback originRun the docs locally or copy the request as curl.
Connection refusedThe sidecar restarted on a new portRead the port from the new ready line.