@wayofmono/wayofteams-tools

extensionmaintained

pi extension: full WayOfTeams MCP integration (legacy + v2 domain-split) with REST dual path — client-first, per-user JWT

by — · v0.1.8 · published 3w ago

$ pi install npm:@wayofmono/wayofteams-tools
downloads/mo
1.4K
stars
2
last push
3w ago
open issues
2

Signals

license: MITtestspi manifest: missinginstall size: —deps: 0peer deps: 0

Download trend

1.4K downloads · last 12 weeks (weekly)

README

@wayofmono/wayofteams-tools

WayOfTeams MCP + REST tools, as a pi extension

Connect the pi coding agent to your WayOfTeams workspace — tickets, plans, docs, standups, kanban, knowledge, memory and more — over the internet, for any tenant, with a single install.

Install · Configure · Commands · Interactive Group Manager · Presets · How it works

pi-package · MCP · REST · client-first · interactive

Why this extension

Pi doesn't ship a built-in MCP client, and generic MCP bridges can't do WayOfTeams' Bearer auth. wayofteams-tools is ours: a first-class MCP client and a direct REST client, built client-first so your whole team can drive WayOfTeams from pi.

  • Full surface — the WayOfTeams MCP exposes ~269 tools across 12 domains: tickets, plans, docs, standups, kanban, ideas, skills, templates, thoughts, knowledge, rules, memory/anchor, agents (orchestration + multi-agent), versions, and more.
  • MCP + REST dual path — talks MCP first; falls back to the REST adapter (/api/v1/tools) and direct REST endpoints when MCP is unavailable, so the chat keeps working.
  • Both endpoint families — supports the legacy /mcp monolith and the v2 /mcp/v2 domain-split surfaces, auto-probing the healthiest.
  • Client-first auth — per-user JWT, resolved from env → pi settings → token file. Never hardcoded, never shared.
  • Entitlement-aware — access denials surface as recoverable messages ("access expired", "tier missing"), not cryptic network errors.
  • Multi-agent ready — registers your agent identity on startup and exposes the coordinator / work-registry / messaging tools (WOTEAMS-322).
  • Interactive Group Manager — press Ctrl+Shift+W for a collapsible panel above the editor to enable/disable tool groups visually.

Requirements

  • pi (0.84+) — loads this extension via jiti, no build step.
  • A WayOfTeams account and an MCP token (get it from your WayOfTeams → Settings → MCP dashboard).

Install

pi install npm:@wayofmono/wayofteams-tools

That's it. pi discovers the package, loads src/index.ts, and the tools appear in the session (new sessions auto-load it; run /reload to pick up changes in an existing one).

From this monorepo during development:

pi install ./packages/@wayofmono/wayofteams-tools

Configure

The extension resolves a token in this order (first hit wins) — never hardcoded:

  1. Environment variable — WAYOFTEAMS_MCP_TOKEN

  2. pi settings.json (~/.pi/agent/settings.json):

    {
      "wayofteams": {
        "token": "<your-jwt>",
        "endpoint": "auto",          // "auto" | "v2" | "legacy" | "rest"
        "enabledGroups": [...],      // optional: override default enabled groups
        "disabledGroups": [...]      // optional: explicitly disable groups
      }
    }
    
  3. Token file — ~/.config/opencode/.wayofteams-mcp-token

The easiest way is the /wayofteams-login command (see below) — it verifies the token live against the server, then persists it to settings.json for you.

Security: tokens are per-user JWTs. A WayOfTeams founders/superadmin token would bypass all entitlements by design — always use a token scoped to your own profile.

Commands

CommandWhat it does
/wayofteams statusActive surface, endpoint, tool count, token state
/wayofteams endpointRe-probe surfaces (v2 → legacy → REST) and reconnect
/wayofteams-login <token>Verify a token live, save it, reconnect
/wayofteams-groups <subcommand>Manage tool groups (see below)
/wayofteams-presets(Reserved) Interactive preset selector

Tool Group Management: /wayofteams-groups

SubcommandDescription
/wayofteams-groups listShow all 13 groups with ✓/✗/○ status
/wayofteams-groups enable <group>Enable one group
/wayofteams-groups disable <group>Disable one group
/wayofteams-groups resetReset to defaults (7 primary groups)
/wayofteams-groups enable-allEnable ALL 13 groups
/wayofteams-groups disable-allDisable ALL (only discovery tools active)
/wayofteams-groups enable-multiple <g1,g2,g3>Enable multiple (comma-separated)
/wayofteams-groups disable-multiple <g1,g2,g3>Disable multiple
/wayofteams-groups preset <name>Apply a preset (see below)

Presets

PresetGroups EnabledUse Case
minimalticketsLowest context, just ticket work
standardtickets, kanban, team, agents, knowledge, memory, adminDefault (7 primary groups)
fullAll 13 groupsMaximum context
team-onlyteam, agentsCoordination only
knowledge-onlyknowledge, memoryResearch/docs only
google-gmail-onlygoogle-gmailJust Gmail
google-drive-onlygoogle-driveJust Drive
google-docs-onlygoogle-docsJust Docs
google-sheets-onlygoogle-sheetsJust Sheets
google-calendar-onlygoogle-calendarJust Calendar
google-allAll 5 Google servicesFull Google Workspace

Usage: /wayofteams-groups preset minimal

Interactive Group Manager

Press Ctrl+Shift+W to toggle a collapsible panel above the editor:

● WayOfTeams Groups (7/13)
  ✓ tickets: Tickets & Plans (enabled)
  ✓ kanban: Kanban Boards (enabled)
  ✓ team: Team & Standups (enabled)
  ✓ agents: Multi-Agent Orchestration (enabled)
  ✓ knowledge: Knowledge Base (enabled)
  ✓ memory: Memory & Anchors (enabled)
  ✓ admin: Admin & Skills (enabled)
  ○ google-gmail: Google Gmail (default-off)
  ○ google-drive: Google Drive (default-off)
  ○ google-docs: Google Docs (default-off)
  ○ google-sheets: Google Sheets (default-off)
  ○ google-calendar: Google Calendar (default-off)
  ○ obsidian: Obsidian Sync (default-off)

└─ ↑↓ navigate  Enter toggle  P presets  C collapse  Q quit

Keyboard Controls

KeyAction
↑ / ↓ / j / kNavigate groups
EnterToggle selected group (enable/disable)
CCollapse/expand panel
POpen preset menu (shows available presets)
Q / EscClose panel

Visual Status

SymbolColorMeaning
✓greenEnabled
✗redDisabled
○dimDefault-off (not in enabled/disabled lists)

Tool Groups (13 total)

GroupToolsDomainDefault
ticketstickets_, plans_core✓
kanbankanban_, boards_, cards_*collab✓
teamstandups_, notifications_, team_*collab✓
agentsagent_, coordinator_, work_, claim_, conflicts_*agents✓
knowledgedocs_, knowledge_, personal_, templates_, ideas_, versions_, thoughts_*knowledge✓
memoryanchors_, memory_, context_, pr_review_memory✓
adminskills_, rules_, config_, deploy_admin✓
google-gmailgoogle_gmail_, gmail_google-gmail✗
google-drivegoogle_drive_, drive_google-drive✗
google-docsgoogle_docs_, docs_google-docs✗
google-sheetsgoogle_sheets_, sheets_google-sheets✗
google-calendargoogle_calendar_, calendar_google-calendar✗
obsidianobsidian_*obsidian✗

How it works

pi session
   │
   ├─ load @wayofmono/wayofteams-tools (via jiti)
   │    └─ register control-plane + discovery tools (safe during load)
   │    └─ resolve token (env → settings → file)  [no hardcode]
   │    └─ probe surfaces: v2 gateway → legacy /mcp → REST adapter
   │         └─ pick healthiest, register its tool set
   │    └─ register /wayofteams commands
   │    └─ register `Ctrl+Shift+W` shortcut for group manager widget
   │
   └─ session_start
        ├─ activate discovery/status tools (runtime is now bound)
        ├─ register agent identity (update_my_work)
        ├─ bind UI context for group manager widget
        └─ ready: model calls tools; matching tools activate on demand
  • Dynamic tool loading — only the discovery/status tools start active; when the model needs a specific tool, search_tools/get_tool_schema results activate it additively via pi.setActiveTools (keeps the prompt small instead of flooding 269 schemas).
  • Multi-agent — registers update_my_work on start and exposes agent_register, agent_list, agent_claim_files, agent_check_conflicts, agent_send_message, agent_coordinator_status so pi agents cooperate with others.
  • Context budget aware — enable only the tool groups you need. The model only sees schemas for enabled groups.

What the model can do

After setup you can ask pi things like:

  • "List my open tickets and their priorities."
  • "Create a feature ticket about … — write the description as markdown."
  • "Show today's standups for the team."
  • "Search the knowledge base for … ."
  • "What cards are on the kanban board?"
  • "Download the latest published version notes."
  • "Disable Google services, I don't need them right now."

The model discovers the exact tools via search_tools and calls them directly.

Development

Requires Node 22+, and (optionally) pi for the live-load smoke test.

# from the womono monorepo root
pnpm install
pnpm --filter @wayofmono/wayofteams-tools test     # vitest (28 tests)
pnpm --filter @wayofmono/wayofteams-tools typecheck
pnpm --filter @wayofmono/wayofteams-tools build    # tsc -> dist/

# smoke-load the extension exactly as pi does (must print "... loaded ...")
cd packages/@wayofmono/wayofteams-tools
echo "list connected tools" | pi -p -e ./src/index.ts

Tests cover the pure modules (src/schema.ts, src/token.ts, src/server.ts, src/client/*) — no pi runtime required. Rebuild dist/ before publishing.

Package layout

AreaFilesNotes
Entrysrc/index.tsregistration-only during load; activation deferred to session_start (pi's runtime-not-initialized contract)
Clientssrc/client/mcp.ts, src/client/rest.tspure JSON-RPC / REST, unit-testable
Surfacesrc/server.tslegacy + v2 catalog, auto-probe order
Authsrc/token.ts, src/config.tsJWT resolution + settings I/O
Registrysrc/registry.tsregisterTool bridge + dynamic activation
Toolssrc/tools/{router,control,fallbacks}.tsdiscovery, control-plane, REST fallbacks
Widgetssrc/widgets/group-manager.tsinteractive overlay for group management
Schemasrc/schema.tsJSON Schema → TypeBox (pure)

License

MIT © WayOf / WayOfMono