# MCP

Source: https://docs.autessa.com/docs/api/poweruser/mcp

> Poweruser endpoints for registering MCP servers and inspecting their tools, resources, and prompts.

# MCP

Register remote MCP (Model Context Protocol) servers for your company, manage their connection and authentication settings, and inspect the tools, resources, and prompts each server exposes.

> All paths on this page are relative to `https://api.autessa.com/autessa_poweruser/mcp/servers`. Every request is a POST with a JSON body, and every ID is an opaque string. See the [Poweruser API overview](/docs/api/poweruser.md) for authentication and conventions.

Registered servers are company-scoped: every member of the linked user's
company sees the same server list. Once registered, a server can back an
`MCP` agent (see [Agents](/docs/api/poweruser/agents.md)) or be turned into
individual tools via the Tools API.

---

## The MCP server object

- `id` (string) — Unique server identifier.
- `companyId` (string) — The company that owns the registration.
- `name` (string) — Display name.
- `serverUrl` (string) — The remote MCP server's URL.
- `description` (string) — What the server provides.
- `authType` (string) — How Autessa authenticates to the server: `NONE`, `API_KEY`, `BEARER_TOKEN`, `BASIC_AUTH`, or `CUSTOM_HEADERS`.
- `hasAuthConfig` (boolean) — Whether credentials are stored for this server. Responses expose only this boolean — the stored `authConfig` itself is **never** returned by any endpoint.
- `createdAt` (string) — ISO-8601 creation timestamp.
- `updatedAt` (string) — ISO-8601 timestamp of the last update.

```json title="MCP server object"
{
  "id": "mS4kT8rW1x",
  "companyId": "cP2mK7dX4v",
  "name": "Internal Knowledge MCP",
  "serverUrl": "https://mcp.acme.internal/sse",
  "description": "Company wiki search and page retrieval.",
  "authType": "BEARER_TOKEN",
  "hasAuthConfig": true,
  "createdAt": "2026-05-12T09:30:00",
  "updatedAt": "2026-06-28T17:42:10"
}
```

---

## List all servers

**POST** `/mcp/servers/all`

Lists every MCP server registered for the company.

### Request parameters

None — send an empty object `{}`.

### Response

- `servers` (array<McpServer>) — The company's registered servers, each in the [MCP server object](#the-mcp-server-object) shape.
- `errors` (array<string>) — Error messages, if any occurred.

```bash title="cURL"
curl https://api.autessa.com/autessa_poweruser/mcp/servers/all \
  -X POST \
  -H "Authorization: $POWERUSER_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

```json title="Response"
{
  "servers": [
    {
      "id": "mS4kT8rW1x",
      "companyId": "cP2mK7dX4v",
      "name": "Internal Knowledge MCP",
      "serverUrl": "https://mcp.acme.internal/sse",
      "authType": "BEARER_TOKEN",
      "hasAuthConfig": true,
      "createdAt": "2026-05-12T09:30:00",
      "updatedAt": "2026-06-28T17:42:10"
    }
  ],
  "errors": []
}
```

---

## Get a server

**POST** `/mcp/servers/get`

Retrieves a single MCP server registration.

### Request parameters

- `serverId` (string, required) — The server to fetch.

### Response

- `server` (McpServer) — The [MCP server object](#the-mcp-server-object). Credentials are never included; check `hasAuthConfig` to see whether any are stored.
- `errors` (array<string>) — Error messages, if any occurred.

```bash title="cURL"
curl https://api.autessa.com/autessa_poweruser/mcp/servers/get \
  -X POST \
  -H "Authorization: $POWERUSER_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "serverId": "mS4kT8rW1x" }'
```

```json title="Response"
{
  "server": {
    "id": "mS4kT8rW1x",
    "companyId": "cP2mK7dX4v",
    "name": "Internal Knowledge MCP",
    "serverUrl": "https://mcp.acme.internal/sse",
    "description": "Company wiki search and page retrieval.",
    "authType": "BEARER_TOKEN",
    "hasAuthConfig": true,
    "createdAt": "2026-05-12T09:30:00",
    "updatedAt": "2026-06-28T17:42:10"
  },
  "errors": []
}
```

---

## Register a server

**POST** `/mcp/servers/create`

Registers a new MCP server for the company. Credentials in `authConfig` are
stored server-side and never returned by later reads — after creation the
response only reports `hasAuthConfig: true`.

### Request parameters

- `name` (string, required) — Display name.
- `serverUrl` (string, required) — The remote server's URL.
- `description` (string) — What the server provides.
- `authType` (string) — `NONE`, `API_KEY`, `BEARER_TOKEN`, `BASIC_AUTH`, or `CUSTOM_HEADERS`.
- `authConfig` (string) — JSON string with the auth details matching `authType` (for example a token, key/value header pairs, or username/password). Write-only.

### Response

- `server` (McpServer) — The newly registered server.
- `errors` (array<string>) — Error messages, if any occurred.

**cURL:**

```bash
curl https://api.autessa.com/autessa_poweruser/mcp/servers/create \
  -X POST \
  -H "Authorization: $POWERUSER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Internal Knowledge MCP",
    "serverUrl": "https://mcp.acme.internal/sse",
    "description": "Company wiki search and page retrieval.",
    "authType": "BEARER_TOKEN",
    "authConfig": "{\"token\": \"mcp-secret-token\"}"
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/autessa_poweruser/mcp/servers/create',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.POWERUSER_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'Internal Knowledge MCP',
      serverUrl: 'https://mcp.acme.internal/sse',
      description: 'Company wiki search and page retrieval.',
      authType: 'BEARER_TOKEN',
      authConfig: JSON.stringify({ token: 'mcp-secret-token' })
    })
  }
);

const { server } = await response.json();
console.log(server.id);
```

**Python:**

```python
import json
import os
import requests

response = requests.post(
    'https://api.autessa.com/autessa_poweruser/mcp/servers/create',
    headers={'Authorization': os.environ['POWERUSER_KEY']},
    json={
        'name': 'Internal Knowledge MCP',
        'serverUrl': 'https://mcp.acme.internal/sse',
        'description': 'Company wiki search and page retrieval.',
        'authType': 'BEARER_TOKEN',
        'authConfig': json.dumps({'token': 'mcp-secret-token'})
    }
)

server = response.json()['server']
```

```json title="Response"
{
  "server": {
    "id": "mS4kT8rW1x",
    "companyId": "cP2mK7dX4v",
    "name": "Internal Knowledge MCP",
    "serverUrl": "https://mcp.acme.internal/sse",
    "description": "Company wiki search and page retrieval.",
    "authType": "BEARER_TOKEN",
    "hasAuthConfig": true,
    "createdAt": "2026-07-01T10:15:00",
    "updatedAt": "2026-07-01T10:15:00"
  },
  "errors": []
}
```

---

## Update a server

**POST** `/mcp/servers/update`

Updates a server's registration. Send `authConfig` only when rotating
credentials — it replaces the stored value and, like everywhere else, is
never echoed back.

### Request parameters

- `serverId` (string, required) — The server to update.
- `name` (string) — New display name.
- `serverUrl` (string) — New server URL.
- `description` (string) — New description.
- `authType` (string) — New auth type: `NONE`, `API_KEY`, `BEARER_TOKEN`, `BASIC_AUTH`, or `CUSTOM_HEADERS`.
- `authConfig` (string) — Replacement JSON auth details. Write-only.

### Response

- `server` (McpServer) — The updated server object.
- `errors` (array<string>) — Error messages, if any occurred.

```bash title="cURL"
curl https://api.autessa.com/autessa_poweruser/mcp/servers/update \
  -X POST \
  -H "Authorization: $POWERUSER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "serverId": "mS4kT8rW1x",
    "name": "Internal Knowledge MCP (prod)",
    "serverUrl": "https://mcp.acme.internal/sse"
  }'
```

```json title="Response"
{
  "server": {
    "id": "mS4kT8rW1x",
    "name": "Internal Knowledge MCP (prod)",
    "serverUrl": "https://mcp.acme.internal/sse",
    "authType": "BEARER_TOKEN",
    "hasAuthConfig": true,
    "updatedAt": "2026-07-01T11:02:33"
  },
  "errors": []
}
```

---

## Delete a server

**POST** `/mcp/servers/delete`

Removes the server registration. Agents or tools that referenced it stop
being able to reach the server.

### Request parameters

- `serverId` (string, required) — The server to delete.

### Response

- `errors` (array<string>) — Error messages, if any occurred.

```bash title="cURL"
curl https://api.autessa.com/autessa_poweruser/mcp/servers/delete \
  -X POST \
  -H "Authorization: $POWERUSER_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "serverId": "mS4kT8rW1x" }'
```

```json title="Response"
{
  "errors": []
}
```

---

## Test the connection

**POST** `/mcp/servers/test-connection`

Connects to the server with its stored auth settings and reports whether the
handshake succeeded, along with how many tools it advertises. Use this after
registering or rotating credentials.

### Request parameters

- `serverId` (string, required) — The server to test.

### Response

- `connected` (boolean) — Whether the connection succeeded.
- `message` (string) — Human-readable result (an error description when `connected` is `false`).
- `toolCount` (integer) — Number of tools the server advertises, when connected.
- `errors` (array<string>) — Error messages, if any occurred.

```bash title="cURL"
curl https://api.autessa.com/autessa_poweruser/mcp/servers/test-connection \
  -X POST \
  -H "Authorization: $POWERUSER_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "serverId": "mS4kT8rW1x" }'
```

```json title="Response"
{
  "connected": true,
  "message": "Connection successful",
  "toolCount": 7,
  "errors": []
}
```

---

## List tools

**POST** `/mcp/servers/list-tools`

Queries the live server for the tools it exposes.

### Request parameters

- `serverId` (string, required) — The server to query.

### Response

- `tools` (array<McpTool>) — Tools the server advertises. Each has `name`, `description`, an `inputSchema` (JSON Schema for the tool's arguments), and optional `metadata` (used for synthetic tools derived from resources or prompts).
- `errors` (array<string>) — Error messages, if any occurred.

```bash title="cURL"
curl https://api.autessa.com/autessa_poweruser/mcp/servers/list-tools \
  -X POST \
  -H "Authorization: $POWERUSER_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "serverId": "mS4kT8rW1x" }'
```

```json title="Response"
{
  "tools": [
    {
      "name": "search_wiki",
      "description": "Full-text search over the company wiki.",
      "inputSchema": {
        "type": "object",
        "properties": {
          "query": { "type": "string" }
        },
        "required": ["query"]
      },
      "metadata": null
    }
  ],
  "errors": []
}
```

---

## List resources

**POST** `/mcp/servers/list-resources`

Queries the live server for the resources it exposes.

### Request parameters

- `serverId` (string, required) — The server to query.

### Response

- `resources` (array<McpResource>) — Resources the server advertises. Each has `uri`, `name`, `description`, and `mimeType`.
- `errors` (array<string>) — Error messages, if any occurred.

```bash title="cURL"
curl https://api.autessa.com/autessa_poweruser/mcp/servers/list-resources \
  -X POST \
  -H "Authorization: $POWERUSER_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "serverId": "mS4kT8rW1x" }'
```

```json title="Response"
{
  "resources": [
    {
      "uri": "wiki://pages/onboarding",
      "name": "Onboarding guide",
      "description": "New-hire onboarding wiki page.",
      "mimeType": "text/markdown"
    }
  ],
  "errors": []
}
```

---

## List prompts

**POST** `/mcp/servers/list-prompts`

Queries the live server for the prompts it exposes.

### Request parameters

- `serverId` (string, required) — The server to query.

### Response

- `prompts` (array<McpPrompt>) — Prompts the server advertises. Each has `name`, `description`, and an `arguments` array of prompt argument definitions.
- `errors` (array<string>) — Error messages, if any occurred.

```bash title="cURL"
curl https://api.autessa.com/autessa_poweruser/mcp/servers/list-prompts \
  -X POST \
  -H "Authorization: $POWERUSER_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "serverId": "mS4kT8rW1x" }'
```

```json title="Response"
{
  "prompts": [
    {
      "name": "summarize_page",
      "description": "Summarize a wiki page for a given audience.",
      "arguments": [
        { "name": "audience", "description": "Who the summary is for", "required": true }
      ]
    }
  ],
  "errors": []
}
```

---

## Errors

| Status | When |
|--------|------|
| `200` | Success — check `errors` for validation messages (unknown server, unreachable URL). |
| `401` | Invalid or missing poweruser key, or the server belongs to another company. |
| `403` | Scoped key without the endpoint in its allow-list. |
| `408` | Server-side error; `errors` contains the message. |

Live-inspection endpoints (`test-connection`, `list-tools`, `list-resources`,
`list-prompts`) depend on the remote server being reachable — connection
failures come back as messages in `errors` (or `connected: false` for
`test-connection`) rather than HTTP-level failures.

---

## Related

- [Poweruser API overview](/docs/api/poweruser.md)
- [Agents (Poweruser API)](/docs/api/poweruser/agents.md)
- [Tools (Poweruser API)](/docs/api/poweruser/tools.md)
- [MCP servers guide](/docs/guide/agentic/mcp-servers.md)
- [MCP tool types](/docs/tools/mcp.md)

