All pages

API reference

Add an MCP server

POST /v1/mcp-servers

View as Markdown

A remote MCP server whose tools agents in the project can be given, by name in their definitions. The same address and credential rules as a tool. Needs tools:write and a live key.

Body

Sent as JSON. A field this operation does not take is refused, so a typo fails loudly.

Field Type Required Description
allowed_tools array of string or null No
auth_key_id string (uuid) or null No A tool credential from the vault, assigned to the project.
name string Yes snake_case: it prefixes every tool name from it.
project_id string (uuid) Yes The project it belongs to.
timeout_ms integer No
url string Yes

Answer

201 with McpServerObject.

Errors

Every error is a problem document with a stable code.

Status When
401 The key is missing, mistyped, unknown, revoked or expired.
403 A credential sent somewhere it does not go yet, or a test key.
409 The project already has a server by that name, or it is frozen.
422 Its address or its credential will not do.
429 Too many requests for this key or its organization; see Retry-After.
500 Something went wrong on our side. Quote the request_id to support.
501 This deployment does not run MCP servers.

Examples

Add an MCP server
#!/bin/sh
# Add an MCP server. With a live key.
curl -sS --fail-with-body -X POST "https://api.aigently.ai/v1/mcp-servers" \
  -H "Authorization: Bearer $AIGENTLY_API_KEY" \
  --json '{
  "project_id": "0b1c2d3e-4f5a-6b7c-8d9e-0f1a2b3c4d5e",
  "name": "orders",
  "url": "https://orders.aigently.ai/mcp",
  "auth_key_id": "2e4a6c8e-0a2c-4e4a-d6c8-e0a2c4e6a8ca",
  "allowed_tools": [
    "lookup_order",
    "cancel_order"
  ]
}'

Try it

Sends this request to the API from your browser, with a test key. Nothing it does rings a phone.