PostHog / PostHog/posthog

PostHog MCP server tool file-download-batch-exports-create breaks Claude for Excel/Word/PowerPoint add-ins (invalid input_schema)

Open
#64,182 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
39.9k
Forks
3.4k
Avg merge
6h 51m
Merged PRs (30d)
232

Description

Summary

The PostHog MCP server emits an input_schema for the tool file-download-batch-exports-create that violates Anthropic's Messages API contract. This single malformed schema causes every prompt sent from Anthropic's official Claude for Excel, PowerPoint, and Word add-ins to fail with HTTP 400 for any user who has the PostHog connector enabled on their claude.ai account.

The failure is atomic: Anthropic's API rejects the entire tools array if any one tool is invalid, so the other 555 valid PostHog tools (and tools from other MCP servers connected to the same account) also stop working. From a user's perspective, the Office add-in appears completely broken — every prompt errors with no useful UI feedback.

Impact

  • Who is affected: every Claude for Office (Excel / PowerPoint / Word) user with the PostHog connector enabled on their claude.ai account.
  • What breaks: every prompt. The add-in is unusable until the user disconnects PostHog.
  • Workaround: users must disconnect PostHog at claude.ai → Settings → Connectors, which also removes PostHog from claude.ai web, Claude Desktop, and Claude Code sessions — i.e., the workaround is "stop using PostHog with Claude entirely."

Reproduction

  1. Connect PostHog at claude.ai → Settings → Connectors.
  2. Open the Claude for Excel add-in (or Word / PowerPoint).
  3. Send any prompt.
  4. Observe the response error.

Anthropic API response

status: 400
apiErrorType: invalid_request_error
requestId: req_011Cc7vDbeq5bab7YwBhwR66
model: claude-sonnet-4-6
error: tools.180.custom.input_schema: input_schema does not support oneOf, allOf, or anyOf at the top level

Root cause

The tool definition for file-download-batch-exports-create has anyOf at the root of input_schema:

{
  "type": "object",
  "anyOf": [
    { "type": "object", "properties": { /* variant body */ } }
  ]
}

Anthropic's tool use spec requires input_schema to be a JSON Schema with type: "object" at the root, with no top-level oneOf / allOf / anyOf. Variants must live inside properties (for example, as a oneOf on a discriminator field like model), not wrap the schema root.

This is almost certainly an artifact of an OpenAPI-to-MCP schema generator emitting a union request body as a root-level anyOf instead of flattening it or pushing it under a discriminator.

Suggested fix

Refactor the schema so the variants live inside properties. For example:

{
  "type": "object",
  "properties": {
    "model": { "type": "string", "enum": ["events", "persons", "sessions"] },
    "file": {
      "oneOf": [ /* per-model file config variants */ ]
    },
    "data_interval_start": { "type": "string", "format": "date-time" },
    "data_interval_end":   { "type": "string", "format": "date-time" },
    "include": { "type": "array", "items": { "type": "string" } },
    "exclude": { "type": "array", "items": { "type": "string" } }
  },
  "required": ["model", "data_interval_start", "data_interval_end"]
}

The fix likely belongs in the schema generator rather than in this one tool's definition, since the same pattern may affect other endpoints with union request bodies. Worth grepping the generated tool schemas for top-level anyOf / oneOf / allOf and fixing any others surfaced.

Secondary observation (not blocking, but worth flagging)

The PostHog MCP server currently registers 433 tools on a single user's account. That's a meaningful share of every Claude prompt's context budget (roughly 40–60K tokens of tool definitions on every request, before the user's actual message is processed). Consider whether all 433 are valuable as default-enabled, or whether to namespace / categorize them so users can opt into subsets. This affects latency, cost, and per-prompt response quality (more tools means more decision overhead for the model).

Environment

  • Claude for Excel add-in, build 79d5f6299bef4e12dc048087c43012cab1773a47
  • Model: claude-sonnet-4-6
  • Date observed: 2026-06-17
  • HAR file available on request

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the OpenAPI-to-MCP schema generator and grep generated tool schemas for top-level anyOf, oneOf, or allOf, beginning with file-download-batch-exports-create. Confirm the resulting input_schema follows Anthropic's object-root contract, check for other affected endpoints, and verify the Claude for Office reproduction no longer returns HTTP 400.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.