Skip to content

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.

  • OpenWork installed, with the workspace or worker where you want Agent Analytics available
  • npx available 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
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.md into share.openworklabs.com and click Open in OpenWork
  • use Create skill in chat and 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.

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:

  1. install or confirm the skill
  2. handle login through browser approval
  3. create or identify the matching Agent Analytics project
  4. run website analysis before adding custom events
  5. install only the high-priority recommended instrumentation
  6. 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:

Terminal window
export AGENT_ANALYTICS_CONFIG_DIR="$PWD/.openwork/agent-analytics"
npx --yes @agent-analytics/[email protected] login --detached
npx --yes @agent-analytics/[email protected] auth status

If shell environment persistence is uncertain, prefix each command instead:

Terminal window
AGENT_ANALYTICS_CONFIG_DIR="$PWD/.openwork/agent-analytics" npx --yes @agent-analytics/[email protected] projects

Before login, make sure .openwork/ is gitignored in the repo or workspace. Never commit .openwork/agent-analytics/config.json.

Use this order when you want the raw CLI steps:

Terminal window
export AGENT_ANALYTICS_CONFIG_DIR="$PWD/.openwork/agent-analytics"
npx --yes @agent-analytics/[email protected] login --detached
npx --yes @agent-analytics/[email protected] create my-site --domain https://mysite.com
npx --yes @agent-analytics/[email protected] scan https://mysite.com --project my-site --json
npx --yes @agent-analytics/[email protected] events my-site --event <first_useful_event> --days 7 --limit 20

That 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:

  1. Extensions
  2. Advanced Settings
  3. Add MCP server

Use this hosted MCP endpoint:

https://mcp.agentanalytics.sh/mcp

OpenWork’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.

Ask OpenWork:

  • List my Agent Analytics projects
  • How 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.

  • 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 --project is required, create or identify the matching Agent Analytics project first, then rerun the scan.
  • If login worked earlier but later says Not logged in, run auth status and confirm AGENT_ANALYTICS_CONFIG_DIR still points at the intended .openwork/agent-analytics path.
  • If the MCP route fails, re-enter the exact endpoint https://mcp.agentanalytics.sh/mcp.
  • If npx is 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_KEY in the runtime environment instead of pasting it into chat.