---
title: "MCP servers API: connect your team's tooling to the gateway"
description: "Attach a Streamable HTTP MCP server to your account, keep its headers sealed, pick which tools are published, and review what the gateway has run lately."
canonical: https://pentestllm.ai/docs/mcp-servers
generated: 2026-11-27T06:25:49.397Z
source: https://pentestllm.ai/docs/mcp-servers
base_url: https://api.pentestllm.ai/v1
---

[Docs](https://pentestllm.ai/docs) / API reference

# MCP servers API

Updated 2026-11-22. Published by PentestLLM.

Tooling endpoints your security team runs can be enrolled here, after which the shared gateway at `https://api.pentestllm.ai/mcp/org` advertises their tools to any agent calling it with one of your API keys. Of the six routes at `https://api.pentestllm.ai/v1`, five enroll a server, list them, read one back, revise it and retire it, and the sixth surfaces what the gateway has recently invoked. A record points at a single Streamable HTTP MCP endpoint published over public https; whatever headers you supply are sealed before storage, resent on each outbound call, and where you give an allowlist only the tools you name are reachable.

## List your servers

`GET /v1/mcp-servers` gives you `data`, one record per server the shared endpoint draws on. Secrets stay out of what you read: in place of header contents a `header_names` field lists which keys are on file, leaving anything sensitive write-only.

## Register a server

`POST /v1/mcp-servers` takes the fields below, and a created record comes back with `201`:

| Field | Type | Notes |
| --- | --- | --- |
| `name` | string, required | The tool namespace, surfaced as `name__tool`: 1 to 32 lowercase letters, digits, `_` or `-`, opening with a letter or digit, with no double underscore and no trailing underscore. |
| `url` | string, required | A public https URL. Private, loopback, link-local and reserved addresses are declined, the test repeats before each call, and redirects are not followed. |
| `headers` | object or null | As many as 20, resent on each call (an Authorization value, say). Sealed at rest and never read back. |
| `tool_allowlist` | array or null | The tools to advertise; all of them when null. |
| `enabled` | boolean | Whether the record is live. |

One account holds as many as 20 servers. A URL that fails the check answers `400 invalid_url` and any other malformed field `400 invalid_request`; a name already taken, or a 21st server, answers `409` with `name_taken` or `limit_reached`.

## Change or remove a server

`GET /v1/mcp-servers/{server_id}` returns a single record, `PATCH /v1/mcp-servers/{server_id}` rewrites any mix of the fields above (passing `headers` discards the stored set in favour of what you send, while null clears every header), and `DELETE /v1/mcp-servers/{server_id}` retires it. Ask for an id your account does not own and the reply is `404 not_found`.

## Read recent tool calls

`GET /v1/mcp-servers/calls` surfaces what the shared endpoint has lately run, latest entry on top. Each row names the moment it fired, which server and which tool, a status of `ok`, `tool_error`, `failed`, `denied` (its allowlist refused the tool) or `blocked` (the key’s tool policy did), and the elapsed time. The arguments show for a row only when the calling key is set to keep bodies. Rows come 50 at a time; raise `limit` to 200, and give `server_id` to confine the list to one record.

## Example

```bash
curl https://api.pentestllm.ai/v1/mcp-servers \
  -H "Authorization: Bearer sk-ptl-live-…" \
  -H "Content-Type: application/json" \
  -d '{"name": "issue-tracker", "url": "https://mcp.example.org/mcp", "enabled": true, "headers": {"Authorization": "Bearer ..."}}'
```

What returns is the saved record with its id and `header_names` only, no header value among them. Every route here authenticates with an admin key, created in the [console](https://app.pentestllm.ai/console); the shared endpoint itself takes an ordinary API key and turns an admin key away.

## Questions

### Do the header secrets I store ever come back?

No. Anything under headers is sealed on the way in and travels only to its own server; a read gives back only header_names, telling you which are present without ever exposing a value, and a PATCH replaces the entire collection instead of merging into it.

### What kind of URL is accepted?

A public https endpoint, nothing else. A loopback, link-local, private or reserved target is declined with 400 invalid_url, the same test runs again ahead of every outbound call, and no redirect is followed, so an enrolled server cannot afterward be steered toward an internal host.

### How do I keep a server from exposing every tool?

List the ones you want in tool_allowlist; leave it null and the gateway passes through everything the server declares. A call to a tool you left off that list lands in GET /v1/mcp-servers/calls marked denied.

## Read next

- [Log export](https://pentestllm.ai/docs/exports)
- [Invoices](https://pentestllm.ai/docs/invoices)
- [Billing details](https://pentestllm.ai/docs/billing-details)
- [Statement signing key](https://pentestllm.ai/docs/statements-public-key)
- [Keys and scopes](https://pentestllm.ai/docs/keys)
- [Usage and signed receipts](https://pentestllm.ai/docs/usage-and-receipts)
- [Spend limits and balance](https://pentestllm.ai/docs/spend-limits)
- [Redaction and guardrails](https://pentestllm.ai/docs/redaction-and-guardrails)
- [Sessions](https://pentestllm.ai/docs/sessions)
- [Embeddings, rerank and moderation](https://pentestllm.ai/docs/retrieval-and-moderation)
- [Batch files](https://pentestllm.ai/docs/files)
- [Batches](https://pentestllm.ai/docs/batches)
- [Status and proof feeds](https://pentestllm.ai/docs/status-and-proof)
- [Count tokens](https://pentestllm.ai/docs/count-tokens)
- [Usage by app](https://pentestllm.ai/docs/stats-apps)
- [App sign-in keys](https://pentestllm.ai/docs/auth-keys)
- [Webhook deliveries](https://pentestllm.ai/docs/webhooks-deliveries)
- [Docs: connect in two minutes](https://pentestllm.ai/docs)
