@chadanalytics/mcp-setup
v0.1.0
Published
Safely connect Chad Analytics hosted MCP to Codex, Claude Code, Cursor, or Claude Desktop
Maintainers
Readme
@chadanalytics/mcp-setup
Connect Chad Analytics' hosted MCP server to Codex, Claude Code, Cursor, or Claude Desktop without hand-editing client config.
The package is dependency-free and ready to run with npx on Node 18+.
1. Create a credential
In the Slack workspace connected to Chad, run:
/chad mcpOnly the person who connected Chad can issue or rotate the credential. Chad shows it once. The current hosted credential is read-only, limited to the connected site, replaces the previous credential, and expires after 90 days.
2. Run setup
Pass the token through the environment so it does not enter shell history or the process argument list:
CHAD_MCP_TOKEN='chad_mcp_…' npx @chadanalytics/mcp-setup codexConfigure more than one client:
CHAD_MCP_TOKEN='chad_mcp_…' npx @chadanalytics/mcp-setup cursor claude-codeConfigure every supported client:
CHAD_MCP_TOKEN='chad_mcp_…' npx @chadanalytics/mcp-setup allIf the environment variable is omitted in an interactive terminal, setup asks
for the credential with a hidden prompt. It deliberately has no --token
option.
Preview without changing files
Validate the planned client paths:
npx @chadanalytics/mcp-setup all --dry-runPrint isolated Chad config snippets with the credential redacted:
npx @chadanalytics/mcp-setup codex cursor --printBoth modes work without a real token and never write files. Print mode does not read or echo existing client configuration, so it cannot expose credentials for other MCP servers.
Where setup writes
| Client | User-level configuration |
| --- | --- |
| Codex | ~/.codex/config.toml |
| Claude Code | ~/.claude.json |
| Cursor | ~/.cursor/mcp.json |
| Claude Desktop, macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Claude Desktop, Windows | %APPDATA%\\Claude\\claude_desktop_config.json |
| Claude Desktop, Linux | ~/.config/Claude/claude_desktop_config.json |
Existing settings and other MCP servers are retained. The chad entry is
created or replaced. Files are written atomically and restricted to the current
user with mode 0600 on platforms that support POSIX permissions.
Because these clients need the bearer token on every hosted MCP request, the
token is stored in their private user configuration. Treat those files as
credentials. Never commit them, paste them into chat, or use project-shared MCP
configuration for this token. Rotate it with /chad mcp if it is exposed.
Custom token variable or endpoint
MY_CHAD_TOKEN='chad_mcp_…' npx @chadanalytics/mcp-setup codex \
--token-env MY_CHAD_TOKENThe production endpoint defaults to https://chadanalytics.com/api/mcp. A
different HTTPS endpoint can be selected for an authorized staging deployment:
CHAD_MCP_TOKEN='chad_mcp_…' npx @chadanalytics/mcp-setup codex \
--url https://staging.example.com/api/mcpVerify
Restart the configured client and ask:
What traffic did I get today?
Which AI assistants sent visitors this week?
What pages did AI crawlers request?
What was my bounce rate in the last 24 hours?
Break down this week's visitors by country and device.
How many signups and how much attributed revenue did I get this month?
Show the drop-off in my signup funnel.The hosted MCP server currently exposes these read-only tools:
| Tool | Returns |
| --- | --- |
| chad_websites_list | Sites available to this credential |
| chad_analytics_overview | Visitors, sessions, bounce rate, duration, AI traffic, goals, and revenue |
| chad_analytics_ai_traffic | Human referrals from ChatGPT, Claude, Perplexity, Gemini, Copilot, Grok, and other detected AI tools |
| chad_analytics_crawlers | Server-side AI answer, indexing, training, and crawler requests |
| chad_analytics_top_pages | Most-viewed pages |
| chad_analytics_dimensions | Country, device, browser, or operating-system breakdown |
| chad_visitor_journeys | Chronological anonymous page and session journeys |
| chad_goals_list | Custom-goal completions, visitors, and values |
| chad_revenue_overview | Attributed revenue, payments, buyers, conversion rate, and revenue per visitor |
| chad_funnels_list | Saved funnel definitions |
| chad_funnel_results | Sequential reach, conversion, drop-off, and attributed revenue |
| chad_segments_list | Saved segments and active exclusions |
| chad_integrations_status | Connected provider status without credentials |
All tools are read-only. The credential is checked on every request and the
server limits results to its authorized Chad tenant and site IDs. A metric may
be empty until its tracker, goal, funnel, or provider connection is configured.
See docs/mcp.md in the Chad repository for the transport and security model.
Development
npm test
npm run check
npm pack --dry-run