Guides
Connect MCP clients
Point Cursor, VS Code, Claude Code and other MCP clients at the gateway.
The gateway is itself an MCP server. Connect a client once and it gets every enabled tool from all your remote servers, with the right credentials added and every call logged.
/api/v1/mcpHow it behaves
- Transport: Streamable HTTP, stateless. Clients send JSON-RPC with
POST; there are no sessions and no server-sent stream (GETandDELETEreturn405). - Auth:
Authorization: Bearer pl_live_…. AddX-Portless-Agentto attribute calls (see Authentication). - Tool names:
namespace__tool, for examplegithub__create_issue. Descriptions are prefixed with the server name, like[GitHub] Open a new issue. - Which tools appear: enabled tools on reachable
http/sseservers, with the input schema the server reports. A server that doesn't answer is skipped and marked offline. - Failures: a turned-off tool or an unreachable server comes back as a tool result with
isError: true, so the model can read what went wrong.
Client setup
Replace pl_live_… with your key. Configs that hold a key are secrets: don't commit them.
Cursor
In ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project):
{
"mcpServers": {
"portless": {
"url": "https://www.initpbj.dev/api/v1/mcp",
"headers": {
"Authorization": "Bearer pl_live_…",
"X-Portless-Agent": "Cursor"
}
}
}
}VS Code
In .vscode/mcp.json. The inputs block makes VS Code prompt for the key and store it securely instead of in the file:
{
"inputs": [
{
"type": "promptString",
"id": "portless-key",
"description": "Portless API key",
"password": true
}
],
"servers": {
"portless": {
"type": "http",
"url": "https://www.initpbj.dev/api/v1/mcp",
"headers": {
"Authorization": "Bearer ${input:portless-key}"
}
}
}
}Claude Code
claude mcp add --transport http portless https://www.initpbj.dev/api/v1/mcp \
--header "Authorization: Bearer $PORTLESS_API_KEY"Other clients
Any client that supports remote Streamable HTTP servers with custom headers works with the URL and header above. For clients that only launch local (stdio) servers, bridge with the mcp-remote package:
{
"mcpServers": {
"portless": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://www.initpbj.dev/api/v1/mcp",
"--header",
"Authorization:${PORTLESS_AUTH}"
],
"env": {
"PORTLESS_AUTH": "Bearer pl_live_…"
}
}
}
}Test the connection
List the tools the gateway exposes with a raw JSON-RPC request:
curl https://www.initpbj.dev/api/v1/mcp \
-H "Authorization: Bearer $PORTLESS_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'Don't see a tool?
http or sse, and that the server is reachable (its status in Servers isn't offline). New tools on a server appear after a sync.