Skip to content

fix(skills): read the project token and host from project-get - #511

Merged
Silthus merged 4 commits into
mainfrom
fix/skills-project-get-token
Nov 16, 2026
Merged

Silthus merged 4 commits into
mainfrom
fix/skills-project-get-token

Conversation

@Silthus

@Silthus Silthus commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Nine skills tell an agent that has no project token to call the PostHog MCP tool projects-get for the project's api_token: mcp-analytics and the eight omnibus/instrument-* skills. The omnibus skills also read a region field from that response to pick the host.

projects-get lists the organization's projects. It returns neither api_token nor region, so the agent's call comes back without what it asked for, and it falls back to asking the person for their token and region. The MCP server's own description of project-get says it is the one tool that returns the project API token, and that api_host is the SDK host.

Changes

  • Each skill lists the projects with projects-get, asks the user which one to use when more than one comes back (as it did before), then calls project-get with that project's id and reads api_token.
  • Before writing the token, the agent tells the user the project's name and confirms it. projects-get lists only the active organization's projects, so a single listed project can still be the wrong one; before this PR the lookup never returned a token, so the agent always asked.
  • The host comes from the api_host field of the same response. The omnibus skills no longer map a region field. The ask-the-user fallback stays.
  • Every other line of each skill is unchanged.

Worth: W-20261112-skills-project-get

Note

🔵 Merge risk: low · two-way door

  • Agents installing PostHog through mcp-analytics or an omnibus/instrument-* skill with no token from their caller still list projects and ask when there are several, then read api_token and api_host from project-get by id instead of failing to find them in projects-get, in both regions.
  • The one way it can misroute is a token written for the wrong project, such as the only project listed in the wrong organization. Every path, a single listed project included, names the project and waits for the user's yes before writing; live agent runs on both the several-projects and the one-project path stopped there with no env file written.
  • Callers that pass a token and host, and every other skill, are unchanged: the diff touches only these two bullets in nine files, and the built bundles differ only in those nine skills plus the mcp-analytics-python variant.
  • Switch-off: none: ships with the next context-mill release, fix forward.
  • Tier: non-critical

How did you test this?

  • Agent runs at ded8183, after main merged in: a fresh Opus 5.5 agent followed the built omnibus-instrument-product-analytics skill on a scratch Node app with no token, against the live PostHog MCP, with no answer for the confirmation. With several projects listed, it asked which one, took the scripted answer, called project-get by id, named the project, asked for confirmation and wrote no file. Told to treat the list as holding one project, it skipped the which-project ask, called project-get, named the project, asked for confirmation and wrote no file. The one-project org is simulated in the prompt: the test organization has several projects.
  • Agent run at df377cc: a fresh Opus 5.5 agent followed the built omnibus-instrument-product-analytics skill on a scratch Node app with no token, against the live PostHog MCP. Unscripted, it listed projects and stopped to ask which one. With the user's answers scripted, it called project-get by id, named the project for confirmation, and wrote .env with that project's api_token and api_host.
  • Live run against the PostHog MCP, the calls the new text prescribes: projects-get {} lists projects with no api_token and no region; project-get {"id": <a project that is not the active one>} returns that project's api_token and api_host (https://us.i.posthog.com for a US project). Evidence saved with fleet proof save.
  • node_modules/.bin/vitest run scripts at ded8183: 31 files, 350 tests passed.
  • node scripts/build.js exits 0 at ded8183. No built zip still holds the old projects-get token text or the region mapping; the new text is in exactly the nine skills' zips plus mcp-analytics-python.

Decisions

Question Answer Who Where
Which tool returns the token and host project-get with no ID, api_host for the host, replacing the region mapping 👍 handoff from the migrate-email thread
Run the final read on Claude while GPT is out of quota yes, run it now 👍 this thread
Confirm the project before writing its token yes, always, by name (judge finding) 🤖 this PR
When to ask which project whenever projects-get lists more than one, as before; the first commit's "if the active project may not be right" gave the agent nothing to check (panel round 1) 🤖 this PR

Involvement: no grilling rounds, no prototypes; reviews: qa-swarm panel (9 lenses, on Claude during a GPT quota outage), a Claude final read (Michael approved the move), a GPT final read with no findings, the GPT judge, and ReviewHog; proof captured.

🤖 Generated with Claude Code

The mcp-analytics skill and the eight omnibus instrument-* skills told an
agent with no project token to call the PostHog MCP tool projects-get for
the project's api_token, and the omnibus skills read a region field from
it for the host. projects-get lists the organization's projects without
the token or a region, so the agent got neither and fell back to asking
the person. project-get with no ID returns the active project's api_token
and api_host; the skills now call it, and use projects-get only to find
another project's ID when the active one may be wrong.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci feature-flags
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci feature-flags/django
  • /wizard-ci feature-flags/next-js
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/go-sdk
  • /wizard-ci mcp-analytics/python-sdk
  • /wizard-ci mcp-analytics/ruby-sdk
  • /wizard-ci mcp-analytics/rust-sdk
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a wizard branch:

  • /wizard-ci all wizard:my-branch

Add wizard:<branch> to any command above to pin the wizard branch. It defaults to main.

Results will be posted here when complete.

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostHog Review · Standard · reviewed 0fc7d39: no findings.

The first commit read the token from the active project and asked only
when that project "may not be" the app's, which an agent cannot check.
The active project is shared state on the MCP key, so in an organization
with several projects the agent could write another project's token with
no error. List the projects with projects-get, ask when more than one
comes back, as the skills did before, then read api_token and api_host
from project-get with the chosen id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostHog Review · Standard · reviewed 4eebdd8: no findings.

@Silthus
Silthus marked this pull request as ready for review November 12, 2026 20:03
@Silthus
Silthus requested a review from a team as a code owner November 12, 2026 20:03
@Silthus
Silthus marked this pull request as draft November 14, 2026 17:47
The judge found that the skills now write the token of the only project
projects-get lists without a word to the user. projects-get lists only the
MCP key's active organization, so an app that belongs to another
organization would silently send to the wrong project. Before this PR the
lookup never returned a token, so the agent always asked. Name the project
from project-get and confirm it with the user before writing the token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@posthog posthog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PostHog Review · Standard · reviewed df377cc: no findings.

@Silthus
Silthus marked this pull request as ready for review November 14, 2026 19:56
Silthus added a commit that referenced this pull request Nov 15, 2026
…ntials

Bring #511 forward to ded8183, which merged main into it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@sarahxsanders sarahxsanders left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll run CI to make sure nothing breaks, but looks good!

@sarahxsanders

Copy link
Copy Markdown
Collaborator

/wizard-ci basic-integration

@wizard-ci-bot

wizard-ci-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

🧙 Wizard CI Results

Trigger ID: 714adde
Workflow: View run

App Confidence PR YARA
basic-integration/android/Jetchat 5/5 #5157 (logs) ✓
basic-integration/angular/angular-saas 5/5 #5159 (logs) ✓
basic-integration/astro/astro-hybrid-marketing 3/5 #5158 (logs) ✓
basic-integration/astro/astro-ssr-docs 5/5 #5156 (logs) ✓
basic-integration/astro/astro-static-marketing 5/5 #5155 (logs) ✓
basic-integration/astro/astro-view-transitions-marketing 5/5 #5154 (logs) ✓
basic-integration/django/django3-saas 3/5 #5160 (logs) ✓
basic-integration/fastapi/fastapi3-ai-saas 5/5 #5162 (logs) ✓
basic-integration/flask/flask3-social-media 4/5 #5161 (logs) ✓
basic-integration/flutter/localsend N/A Failed (logs) ✓
basic-integration/javascript-node/express-todo 3/5 #5165 (logs) ✓
basic-integration/javascript-node/fastify-blog 4/5 #5164 (logs) ✓
basic-integration/javascript-node/hono-links 5/5 #5163 (logs) ✓
basic-integration/javascript-node/koa-notes 4/5 #5166 (logs) ✓
basic-integration/javascript-node/native-http-contacts 5/5 #5167 (logs) ✓
basic-integration/javascript-web/saas-dashboard 4/5 #5168 (logs) ✓
basic-integration/laravel/laravel12-saas N/A Failed (logs) ✓
basic-integration/next-js/15-app-router-saas ⏳ pending
basic-integration/next-js/15-app-router-todo 4/5 #5169 (logs) ✓
basic-integration/next-js/15-pages-router-saas 4/5 #5171 (logs) ✓
basic-integration/next-js/15-pages-router-todo 4/5 #5172 (logs) ✓
basic-integration/nuxt/movies-nuxt-3-6 5/5 #5173 (logs) ✓
basic-integration/nuxt/movies-nuxt-4 5/5 #5177 (logs) ✓
basic-integration/python/meeting-summarizer ⏳ pending
basic-integration/rails/fizzy 5/5 #5179 (logs) ✓
basic-integration/react-native/expo-react-native-hacker-news 5/5 #5180 (logs) ✓
basic-integration/react-native/react-native-saas 5/5 #5176 (logs) ✓
basic-integration/react-router/react-router-v7-project 5/5 #5175 (logs) ✓
basic-integration/react-router/rrv7-starter 4/5 #5178 (logs) ✓
basic-integration/react-router/saas-template 4/5 #5182 (logs) ✓
basic-integration/react-router/shopper 3/5 #5181 (logs) ✓
basic-integration/sveltekit/CMSaasStarter 5/5 #5186 (logs) ✓
basic-integration/swift/hackers-ios 4/5 #5188 (logs) ✓
basic-integration/tanstack-router/tanstack-router-code-based-saas 5/5 #5184 (logs) ✓
basic-integration/tanstack-router/tanstack-router-file-based-saas 3/5 #5183 (logs) ✓
basic-integration/tanstack-start/tanstack-start-saas 5/5 #5185 (logs) ✓
basic-integration/vue/movies 4/5 #5187 (logs) ✓

Configuration

Setting Value
Wizard ref main
Context Mill ref fix/skills-project-get-token
PostHog ref master

Search for trigger ID 714adde in wizard-workbench PRs.

@Silthus
Silthus merged commit d5ba3bb into main Nov 16, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants