Mcp
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
DELETE | |
POST | |
GET | |
POST | |
GET | |
GET | |
PATCH | |
POST |
Delete mcp gateway servers
The team's gateway server registry. The registry is sparse: rows appear
through the install/share/OAuth-start flows in views.py, or when an admin
toggles an untouched catalog template here (set_template_enabled).
Servers with no row follow the team config's default_servers_enabled.
Required API key scopes
project:writePath parameters
- idstring
Example request
DELETE /api /projects /:project_id /mcp_gateway /servers /:idExample response
Status 204 No response body
Create mcp gateway servers policies
Upsert per-tool states for a scope, returning the re-resolved catalog.
Required API key scopes
project:writePath parameters
- idstring
Request parameters
- scope_typeDefault:
team - scope_user_idinteger
- scope_service_account_idstring
- policiesarray
Response
Example request
POST /api /projects /:project_id /mcp_gateway /servers /:id /policiesExample response
Status 200
Retrieve mcp gateway servers tools
Tool catalog with the resolved policy for a scope.
Required API key scopes
project:readPath parameters
- idstring
Query parameters
- scope_service_account_idstring
- scope_typestringDefault:
teamOne of:"team""member""agent" - scope_user_idinteger
Response
Example request
GET /api /projects /:project_id /mcp_gateway /servers /:id /toolsExample response
Status 200
Create mcp gateway servers set template enabled
Enable or disable a catalog template for the team (admin-only), materializing its gateway registration on the first toggle.
Required API key scopes
project:writeRequest parameters
- template_idstring
- enabledboolean
Response
Example request
POST /api /projects /:project_id /mcp_gateway /servers /set_template_enabledExample response
Status 200
List all mcp gateway service accounts
PostHog's built-in agents and their MCP access grants.
The catalog is fixed. Projects can pause an agent's MCP access and grant or revoke servers, but cannot create, rename, rotate, or delete agents.
Required API key scopes
project:readQuery parameters
- limitinteger
- offsetinteger
Response
Example request
GET /api /projects /:project_id /mcp_gateway /service_accountsExample response
Status 200
Retrieve mcp gateway service accounts
PostHog's built-in agents and their MCP access grants.
The catalog is fixed. Projects can pause an agent's MCP access and grant or revoke servers, but cannot create, rename, rotate, or delete agents.
Required API key scopes
project:readPath parameters
- idstring
Response
Example request
GET /api /projects /:project_id /mcp_gateway /service_accounts /:idExample response
Status 200
Update mcp gateway service accounts
PostHog's built-in agents and their MCP access grants.
The catalog is fixed. Projects can pause an agent's MCP access and grant or revoke servers, but cannot create, rename, rotate, or delete agents.
Required API key scopes
project:writePath parameters
- idstring
Request parameters
- status
Response
Example request
PATCH /api /projects /:project_id /mcp_gateway /service_accounts /:idExample response
Status 200
Create mcp gateway service accounts access
Share, or stop sharing, one gateway server with this agent.
Sharing is personal. enabled=true delegates the caller's own
connection, and the agent may use it only when acting for the caller,
unless the caller sends scope=team to lend it to the project's agent
runs generally. Scope only ever applies to the caller's own share: it is
their credential to lend, so no admin permission is involved and no
member can change someone else's share.
enabled=false removes the caller's own share and leaves other members'
shares, and the agent's tool policies, in place.
Project admins can send all=true alongside enabled=false to remove
every member's share of this server with this agent, along with the
agent's tool policies for it.
Required API key scopes
project:writePath parameters
- idstring
Request parameters
- gateway_server_idstring
- enabledboolean
- scopeDefault:
personal - allbooleanDefault:
false - policiesarray
Response
Example request
POST /api /projects /:project_id /mcp_gateway /service_accounts /:id /access










