agent-connector
agent-connector serves two distinct audiences. Pick the track first.
- MCP developer: building an MCP integration. They depend on
@ken-jo/agent-connector, write defineConnector({...}), expose their own
branded package/bin, and deploy to detected agent hosts through that brand.
- Agent-CLI user: not authoring a connector. They use
agent-connector usage only, which scans agent host logs read-only and reports
whole-conversation totals by CLI/model/project/session/day.
The accuracy boundary is strict: developer telemetry can measure per-MCP and
per-tool tokens only for the developer's own wrapped stdio server. Connector-free
usage cannot itemize arbitrary MCPs or tools because agent hosts do not log
per-tool attribution.
Read The Right Reference
This skill is intentionally small. Read the relevant reference file before
acting:
references/package-first.md — required for any scaffold, code review,
wizard, docs, or naming/identity decision. It defines the package-first
contract and what not to ask the user for.
references/authoring.md — required when creating or editing
agent-connector.config.*, SDK imports, hooks, commands, skills, subagents,
memory, statusline options/host overrides, action metadata/host overrides, or
platform escape hatches.
references/cli-workflow.md — required when wiring bin.mjs, install,
uninstall, upgrade/sync/update, doctor, package, or marketplace/direct install
flows.
references/telemetry.md — required for any token, usage, leaderboard,
privacy, opt-out, or "which MCP/tool costs tokens?" question.
references/agent-readiness.md — required when improving agent-facing docs,
skills, scaffold/boilerplate, lint/audit, MCP-server affordances, or other
"make this easy for AI agents" surfaces.
For exhaustive field-level detail, use llms-full.txt; statusline and action
SDK changes should specifically be checked against §2.5 and §2.6. For the short
map, use llms.txt. For current host coverage and platform count, use the
website /coverage page; do not copy a fixed count into this skill. The public
website mirrors developer docs under /docs/dev.
Default Agent Procedure
- Inspect the target package's
package.json first.
- Use
package.json name, mcpName, bin, and version as the source of
truth for MCP identity, host alias/display label, public command, and
connector version.
- Do not request separate connector id, display name, bin name, or version
unless metadata is absent or the user explicitly needs a legacy/multi-instance
override.
When showing generated host configs, comment that host-native ids are install
artifacts derived from package metadata, not second user-maintained inputs.
- Import new authoring code from
@ken-jo/agent-connector/sdk.
For statusline/actions, use SDK capability introspection or the offline
harness to confirm host behavior; unsupported hosts should be documented as
disabled or skip-warn, not inferred support.
- Put
createConnectorCli({ packageJson, connector }) in the developer's
package bin from @ken-jo/agent-connector/cli; comment that packageJson
supplies identity while connector supplies behavior.
- Foreground the developer's brand in MCP lifecycle/runtime commands:
npx @acme/acme-db-mcp install, acme-db doctor --probe, acme-db upgrade,
acme-db uninstall, acme-db telemetry report, etc.
- Keep framework tooling separate:
package emits host/MCP distribution
artifacts, so document it as npx @ken-jo/agent-connector package --connector ... (or global agent-connector package for developers who installed the
framework CLI).
- Use other
npx @ken-jo/agent-connector ... --connector commands only as a
local framework development/debug fallback.
- Verify with typecheck/tests, SDK offline harnesses when relevant, then
doctor --probe when a real stdio server/host is available.
Hard Do-Nots
- Do not use agent-connector to write a brand-new MCP server protocol
implementation. It deploys and measures an existing server command/URL.
- Do not present global
@ken-jo/agent-connector install as the normal user
install path for a branded MCP package.
- Do not claim connector-free
usage can report per-MCP or per-tool cost.
- Do not duplicate package metadata in
defineConnector unless there is a real
override case.
- Do not patch host
statusLine keys through configPatch; use the modeled
statusline surface.
- Do not silently drop unsupported host surfaces; the expected behavior is
native support, disabled, or skip-warn with a reason.
1---2name: agent-connector3description: agent-connector4---56# agent-connector78agent-connector serves two distinct audiences. Pick the track first.910- **MCP developer**: building an MCP integration. They depend on11 `@ken-jo/agent-connector`, write `defineConnector({...})`, expose their own12 branded package/bin, and deploy to detected agent hosts through that brand.13- **Agent-CLI user**: not authoring a connector. They use14 `agent-connector usage` only, which scans agent host logs read-only and reports15 whole-conversation totals by CLI/model/project/session/day.1617The accuracy boundary is strict: developer telemetry can measure per-MCP and18per-tool tokens only for the developer's own wrapped stdio server. Connector-free19`usage` cannot itemize arbitrary MCPs or tools because agent hosts do not log20per-tool attribution.2122## Read The Right Reference2324This skill is intentionally small. Read the relevant reference file before25acting:2627- `references/package-first.md` — required for any scaffold, code review,28 wizard, docs, or naming/identity decision. It defines the package-first29 contract and what not to ask the user for.30- `references/authoring.md` — required when creating or editing31 `agent-connector.config.*`, SDK imports, hooks, commands, skills, subagents,32 memory, statusline options/host overrides, action metadata/host overrides, or33 platform escape hatches.34- `references/cli-workflow.md` — required when wiring `bin.mjs`, install,35 uninstall, upgrade/sync/update, doctor, package, or marketplace/direct install36 flows.37- `references/telemetry.md` — required for any token, usage, leaderboard,38 privacy, opt-out, or "which MCP/tool costs tokens?" question.39- `references/agent-readiness.md` — required when improving agent-facing docs,40 skills, scaffold/boilerplate, lint/audit, MCP-server affordances, or other41 "make this easy for AI agents" surfaces.4243For exhaustive field-level detail, use `llms-full.txt`; statusline and action44SDK changes should specifically be checked against §2.5 and §2.6. For the short45map, use `llms.txt`. For current host coverage and platform count, use the46website `/coverage` page; do not copy a fixed count into this skill. The public47website mirrors developer docs under `/docs/dev`.4849## Default Agent Procedure50511. Inspect the target package's `package.json` first.522. Use `package.json` `name`, `mcpName`, `bin`, and `version` as the source of53 truth for MCP identity, host alias/display label, public command, and54 connector version.553. Do not request separate connector id, display name, bin name, or version56 unless metadata is absent or the user explicitly needs a legacy/multi-instance57 override.58 When showing generated host configs, comment that host-native ids are install59 artifacts derived from package metadata, not second user-maintained inputs.604. Import new authoring code from `@ken-jo/agent-connector/sdk`.61 For statusline/actions, use SDK capability introspection or the offline62 harness to confirm host behavior; unsupported hosts should be documented as63 disabled or skip-warn, not inferred support.645. Put `createConnectorCli({ packageJson, connector })` in the developer's65 package bin from `@ken-jo/agent-connector/cli`; comment that `packageJson`66 supplies identity while `connector` supplies behavior.676. Foreground the developer's brand in MCP lifecycle/runtime commands:68 `npx @acme/acme-db-mcp install`, `acme-db doctor --probe`, `acme-db upgrade`,69 `acme-db uninstall`, `acme-db telemetry report`, etc.707. Keep framework tooling separate: `package` emits host/MCP distribution71 artifacts, so document it as `npx @ken-jo/agent-connector package --connector72 ...` (or global `agent-connector package` for developers who installed the73 framework CLI).748. Use other `npx @ken-jo/agent-connector ... --connector` commands only as a75 local framework development/debug fallback.769. Verify with typecheck/tests, SDK offline harnesses when relevant, then77 `doctor --probe` when a real stdio server/host is available.7879## Hard Do-Nots8081- Do not use agent-connector to write a brand-new MCP server protocol82 implementation. It deploys and measures an existing server command/URL.83- Do not present global `@ken-jo/agent-connector` install as the normal user84 install path for a branded MCP package.85- Do not claim connector-free `usage` can report per-MCP or per-tool cost.86- Do not duplicate package metadata in `defineConnector` unless there is a real87 override case.88- Do not patch host `statusLine` keys through `configPatch`; use the modeled89 `statusline` surface.90- Do not silently drop unsupported host surfaces; the expected behavior is91 native support, disabled, or skip-warn with a reason.