Connecting your AI client
Configuration for common MCP clients. Replace pts_YOUR_KEY with your own key, and keep it out of shared or committed files.
Claude Code#
claude mcp add --transport http pentesys https://api.pentesys.io/mcp \
--header "Authorization: Bearer pts_YOUR_KEY"
Run claude mcp list to check it is connected, then ask, for example, "Using Pentesys, list my open High findings". To keep the key out of your shell history, read it from an environment variable:
claude mcp add --transport http pentesys https://api.pentesys.io/mcp \
--header "Authorization: Bearer $PENTESYS_API_KEY"
Claude Desktop, Cursor and other clients with a JSON configuration#
Add a server entry like this to the client's MCP configuration file. The file's name and location depend on the client; see its documentation.
{
"mcpServers": {
"pentesys": {
"type": "http",
"url": "https://api.pentesys.io/mcp",
"headers": { "Authorization": "Bearer pts_YOUR_KEY" }
}
}
}
Restart the client after saving. If your client only supports local (stdio) servers, use an MCP proxy that forwards to a remote HTTP server and passes the header.
Your own agent#
The connector speaks MCP over Streamable HTTP, statelessly:
- Send each JSON-RPC message as a
POSTtohttps://api.pentesys.io/mcpwithContent-Type: application/jsonand your key. One message per request (no batches); requests up to 64 KB. - Responses are plain JSON, not an event stream. No session is kept between requests. A
GETreturns405. - Supported methods:
initialize,ping,tools/list,tools/call. Notifications get202 Accepted. - Requests from web browsers (with an
Originheader) are refused unless that origin is allowed.
curl -s https://api.pentesys.io/mcp \
-H "Authorization: Bearer $PENTESYS_API_KEY" -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"acme-agent","version":"1.0"}}}'
curl -s https://api.pentesys.io/mcp \
-H "Authorization: Bearer $PENTESYS_API_KEY" -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
curl -s https://api.pentesys.io/mcp \
-H "Authorization: Bearer $PENTESYS_API_KEY" -H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"list_findings","arguments":{"severity":"Critical","status":"open"}}}'
A successful call returns the data both as text and as structuredContent:
{
"jsonrpc": "2.0", "id": 3,
"result": {
"content": [ { "type": "text", "text": "{\n \"data\": [ { \"code\": \"FND-1042\", … } ],\n \"meta\": { … }\n}" } ],
"structuredContent": { "data": [ { "code": "FND-1042", "title": "SQL injection in product search", "severity": "Critical" } ],
"meta": { "page": 1, "per_page": 25, "total": 1, "last_page": 1 } },
"isError": false
}
}
A tool that runs but fails (bad argument, missing permission) returns a normal result with "isError": true and an explanation the assistant can act on, for example "You do not have permission to do that. (forbidden)".
Checking the connection#
- Ask the assistant "Using Pentesys, who am I?" It should call
whoamiand report your name, organisation and roles. - If it does not see Pentesys tools, restart the client and check the URL ends in
/mcp(not/v1). - If calls fail with
invalid_api_key, the header is missing a part (it must beBearer pts_…) or the key has expired. See Troubleshooting.
Keeping the key safe#
- Create a separate key for each client, named after it, so you can revoke one without affecting others.
- Do not commit configuration files that contain the key. Where your client supports it, read the key from an environment variable.
- Choose a short expiry and rotate keys regularly.