Mcp

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

Endpoints

POST
POST

Create mcp tools

Invoke an MCP tool by name.

This endpoint allows MCP callers to invoke Max AI tools directly without going through the full LangChain conversation flow.

Scopes are resolved dynamically per tool via dangerously_get_required_scopes.

Path parameters

  • tool_name
    string

Example request

POST /api/environments/:project_id/mcp_tools/:tool_name
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_tools/:tool_name/

Example response

Status 200

Create docs

Run a hybrid (semantic + full-text) RAG search over the PostHog documentation via Inkeep. Returns a markdown body with title, URL, and excerpt for each match for the agent to cite back to the user.

Required API key scopes

project:read

Request parameters

  • query
    string

Response


Example request

POST /api/environments/:project_id/mcp_tools/docs_search
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_tools/docs_search/\
-d query="string"

Example response

Status 200 Markdown-formatted documentation results.
RESPONSE
{
"content": "string"
}

Community questions

Questions about this page? or post a community question.