Transports
Every transport funnels into one set of handlers, so behaviour and payloads are identical whichever one you use.
On this page
MCP over streamable HTTP
The native transport for Model Context Protocol clients. The endpoint accepts GET and POST; sessions are keyed by the Mcp-Session-Id header the server returns from the initialize call.
https://mcp.postmcpai.com/mcp?apikey=pmcp_sec_YOUR_SECRET_KEYClient-by-client setup for Claude, ChatGPT, Claude Desktop, Cursor and Claude Code is in the guide Connect an AI client. A tool call on the wire looks like this:
{
"method": "tools/call",
"params": {
"name": "get_connected_accounts",
"arguments": {}
}
}REST tool execution
Every tool is also a POST endpoint under /api/tools/:name. Plain JSON in, plain JSON out; the name segment is the tool name in snake_case. Tools without arguments take an empty object.
curl -X POST "https://api.postmcpai.com/api/tools/get_user_info" \
-H "Content-Type: application/json" \
-H "x-api-key: $POSTMCPAI_API_KEY" \
-d '{}'Each tool page shows the same request in cURL, JavaScript, Python and as an MCP call. Start with get_user_info: a 200 means the key is wired up correctly.
OpenAPI and Custom GPTs
An OpenAPI 3.0.1 document is generated per request against the host it is served from, so it can be imported straight into a ChatGPT Custom GPT action or any OpenAPI tooling.
https://api.postmcpai.com/openapi.json- 1In the Custom GPT editor, add an Action and import from URLPaste the spec URL above. Every tool appears as an operation.
- 2Set authentication to API keyHeader name
x-api-key, orAuthorizationwith the Bearer prefix. Paste your key. - 3Test with get_user_infoAsk the GPT who it is signed in as. It should answer with the plan and credit balance.
Running the server yourself
The server behind all three transports is open source, MIT licensed and published on npm as @postmcpai/server. Without a PORT it speaks MCP over stdio for local clients; with one it serves the HTTP endpoints above from your own host.
export POSTMCPAI_API_KEY="pmcp_sec_YOUR_SECRET_KEY"
export PORT=3000
npx -y @postmcpai/server| Variable | Meaning | Default |
|---|---|---|
| POSTMCPAI_API_KEY | Required. The key used for every backend call. | none |
| POSTMCPAI_PROJECT_ID | Workspace to act on, overriding the one bound to the key. | the key’s workspace |
| PORT | Set it to serve streamable HTTP, REST and OpenAPI. Unset means stdio. | unset |
Source, licence and the full environment reference are on the MCP server page.