OpenWork
For OpenWork, the cleanest default is the regular Agent Analytics skill plus the official pinned CLI. That keeps the workflow agent-native, works in a local desktop workspace or a connected worker, and is easier to steer than raw MCP for day-to-day setup work.
The important detail: for live Agent Analytics work inside OpenWork, keep the runtime on the official CLI through npx --yes @agent-analytics/[email protected] .... The skill provides the workflow and guardrails around that CLI.
Prerequisites
Section titled “Prerequisites”- OpenWork installed, with the workspace or worker where you want Agent Analytics available
npxavailable in the runtime OpenWork uses for command execution- Access to the Google or GitHub sign-in you want to connect when OpenWork opens browser approval or sends you a login link
Recommended: create a workspace-local Agent Analytics skill
Section titled “Recommended: create a workspace-local Agent Analytics skill”The easiest path is to use OpenWork’s built-in skill flow and point it at the official Agent Analytics skill markdown.
Create a workspace-local OpenWork skill named agent-analytics from the official Agent Analytics SKILL.md at https://raw.githubusercontent.com/Agent-Analytics/agent-analytics-skill/main/skills/agent-analytics/SKILL.md. Save it to `.opencode/skills/agent-analytics/SKILL.md`, keep the instructions intact, reload the workspace if needed, and tell me when it is ready.Official skill sources:
OpenWork also supports the other native import routes:
- paste or upload the same
SKILL.mdinto share.openworklabs.com and clickOpen in OpenWork - use
Create skill in chatand paste the skill into that flow - place the file directly at
.opencode/skills/agent-analytics/SKILL.md
OpenWork’s own import docs are here:
Once installed, OpenWork can create projects, generate tracking snippets, query stats, inspect funnels, run website analysis, and schedule recurring analytics work from the same workspace.
Ask OpenWork to set up the project
Section titled “Ask OpenWork to set up the project”After the skill is available, tell OpenWork:
Set up Agent Analytics for this project. If approval is needed, open the browser for me or send me the login link and wait. I will sign in with Google or GitHub, approve it, and paste back any finish code if you need it. Then create or identify the matching Agent Analytics project, run website analysis for this site so you know what my agent should track first, install only the high-priority minimum viable instrumentation, explain what each event enables, and verify the first useful recommended event.That gives OpenWork the right order of operations:
- install or confirm the skill
- handle login through browser approval
- create or identify the matching Agent Analytics project
- run website analysis before adding custom events
- install only the high-priority recommended instrumentation
- verify the first useful event
Detached login plus a finish-code reply is the safest default if your OpenWork task is running on a remote worker, a shared machine, or any shell where a localhost callback may not stay attached to the original task.
Keep auth in a workspace-managed path for remote or disposable workers
Section titled “Keep auth in a workspace-managed path for remote or disposable workers”If OpenWork is driving commands through a remote worker or a shell you do not fully control, do not rely on the default home config path for Agent Analytics auth. Use a workspace-managed directory first:
export AGENT_ANALYTICS_CONFIG_DIR="$PWD/.openwork/agent-analytics"If shell environment persistence is uncertain, prefix each command instead:
AGENT_ANALYTICS_CONFIG_DIR="$PWD/.openwork/agent-analytics" npx --yes @agent-analytics/[email protected] projectsBefore login, make sure .openwork/ is gitignored in the repo or workspace. Never commit .openwork/agent-analytics/config.json.
First setup flow in OpenWork
Section titled “First setup flow in OpenWork”Use this order when you want the raw CLI steps:
export AGENT_ANALYTICS_CONFIG_DIR="$PWD/.openwork/agent-analytics"npx --yes @agent-analytics/[email protected] events my-site --event <first_useful_event> --days 7 --limit 20That gives OpenWork a project-scoped scan, the minimum viable instrumentation recommendation, and a concrete verification step.
Optional: add the hosted MCP server instead
Section titled “Optional: add the hosted MCP server instead”Use MCP in OpenWork only when you specifically want connector-style tool calls instead of the skill plus CLI workflow.
In OpenWork, go to:
ExtensionsAdvanced SettingsAdd MCP server
Use this hosted MCP endpoint:
https://mcp.agentanalytics.sh/mcpOpenWork’s MCP docs are here:
This OpenWork path is aimed at OAuth-style MCP servers with dynamic user registration. If you want the most guided setup and instrumentation flow, keep the skill path as the default and use MCP as the lower-level alternative.
Verify the install
Section titled “Verify the install”Ask OpenWork:
List my Agent Analytics projectsHow is my-site doing this week?What are the top pages for my-site this week?Create a daily 8:00 AM OpenWork automation that queries Agent Analytics for the last 24 hours across my projects and sends me a short brief with anomalies, winners, drop-offs, and one recommended action.
If you have not created your first real project yet, continue with First Project in 5 Minutes.
Troubleshooting
Section titled “Troubleshooting”- If the skill file is present but OpenWork does not see it yet, reload the workspace after import.
- If OpenWork pauses on browser approval, complete the sign-in and paste back any finish code the task asks for.
- If
scan <url>says--projectis required, create or identify the matching Agent Analytics project first, then rerun the scan. - If login worked earlier but later says
Not logged in, runauth statusand confirmAGENT_ANALYTICS_CONFIG_DIRstill points at the intended.openwork/agent-analyticspath. - If the MCP route fails, re-enter the exact endpoint
https://mcp.agentanalytics.sh/mcp. - If
npxis unavailable in the runtime OpenWork is using, install the required Node.js runtime first or temporarily switch to the MCP path. - If you intentionally use a compatibility API key for direct HTTP debugging, keep
AGENT_ANALYTICS_API_KEYin the runtime environment instead of pasting it into chat.