Mcp Server

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET
POST
GET
PATCH
DELETE
POST
GET
POST

List all mcp server installations

Required API key scopes

project:read

Path parameters

  • project_id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/environments/:project_id/mcp_server_installations
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/mcp_server_installations/

Example response

Status 200
RESPONSE
{
"count": 123,
"next": "http://api.example.org/accounts/?offset=400&limit=100",
"previous": "http://api.example.org/accounts/?offset=200&limit=100",
"results": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"server_id": "820efca4-4a15-4ab7-82fc-9e76f6d61325",
"name": "string",
"display_name": "string",
"url": "http://example.com",
"description": "string",
"auth_type": "api_key",
"is_enabled": true,
"needs_reauth": true,
"pending_oauth": true,
"proxy_url": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
]
}

Create mcp server installations

Required API key scopes

project:write

Path parameters

  • project_id
    string

Request parameters

  • display_name
    string
  • url
    string
  • description
    string
  • auth_type
  • is_enabled
    boolean

Response


Example request

POST /api/environments/:project_id/mcp_server_installations
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/mcp_server_installations/\
-d server_id="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"server_id": "820efca4-4a15-4ab7-82fc-9e76f6d61325",
"name": "string",
"display_name": "string",
"url": "http://example.com",
"description": "string",
"auth_type": "api_key",
"is_enabled": true,
"needs_reauth": true,
"pending_oauth": true,
"proxy_url": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Retrieve mcp server installations

Required API key scopes

project:read

Path parameters

  • id
    string
  • project_id
    string

Response


Example request

GET /api/environments/:project_id/mcp_server_installations/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/mcp_server_installations/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"server_id": "820efca4-4a15-4ab7-82fc-9e76f6d61325",
"name": "string",
"display_name": "string",
"url": "http://example.com",
"description": "string",
"auth_type": "api_key",
"is_enabled": true,
"needs_reauth": true,
"pending_oauth": true,
"proxy_url": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Update mcp server installations

Required API key scopes

project:read

Path parameters

  • id
    string
  • project_id
    string

Request parameters

  • display_name
    string
  • description
    string
  • is_enabled
    boolean

Response


Example request

PATCH /api/environments/:project_id/mcp_server_installations/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/mcp_server_installations/:id/\
-d display_name="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"server_id": "820efca4-4a15-4ab7-82fc-9e76f6d61325",
"name": "string",
"display_name": "string",
"url": "http://example.com",
"description": "string",
"auth_type": "api_key",
"is_enabled": true,
"needs_reauth": true,
"pending_oauth": true,
"proxy_url": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Delete mcp server installations

Required API key scopes

project:read

Path parameters

  • id
    string
  • project_id
    string

Example request

DELETE /api/environments/:project_id/mcp_server_installations/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/mcp_server_installations/:id/

Example response

Status 204 No response body

Create mcp server installations proxy

Required API key scopes

project:read

Path parameters

  • id
    string
  • project_id
    string

Request parameters

  • display_name
    string
  • url
    string
  • description
    string
  • auth_type
  • is_enabled
    boolean

Example request

POST /api/environments/:project_id/mcp_server_installations/:id/proxy
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/mcp_server_installations/:id/proxy/\
-d server_id="string"

Example response

Status 200

Retrieve mcp server installations authorize

Required API key scopes

project:read

Path parameters

  • project_id
    string

Query parameters

  • install_source
    string
    Default: posthog
    One of: "posthog""posthog-code"
  • posthog_code_callback_url
    string
    Default:
  • server_id
    string

Example request

GET /api/environments/:project_id/mcp_server_installations/authorize
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/mcp_server_installations/authorize/

Example response

Status 200 No response body

Create mcp server installations install custom

Required API key scopes

project:read

Path parameters

  • project_id
    string

Request parameters

  • name
    string
  • url
    string
  • auth_type
  • api_key
    string
    Default:
  • description
    string
    Default:
  • install_source
    Default: posthog
  • posthog_code_callback_url
    string
    Default:

Response


Example request

POST /api/environments/:project_id/mcp_server_installations/install_custom
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:project_id/mcp_server_installations/install_custom/\
-d name="string",\
-d url="string",\
-d auth_type=undefined

Example response

Status 200
RESPONSE
{
"redirect_url": "http://example.com"
}
Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"server_id": "820efca4-4a15-4ab7-82fc-9e76f6d61325",
"name": "string",
"display_name": "string",
"url": "http://example.com",
"description": "string",
"auth_type": "api_key",
"is_enabled": true,
"needs_reauth": true,
"pending_oauth": true,
"proxy_url": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Community questions

Questions about this page? or post a community question.