Skip to content

Commit 88c43ca

Browse files
authored
Merge pull request #2 from mycollablab/dev
Add MCP server: read/write tools, HTTP transport, DXT extension, skill bundle, Claude Desktop docs
2 parents 302a0a4 + 50f4387 commit 88c43ca

81 files changed

Lines changed: 93698 additions & 46626 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ webex
33
webex-cli
44
*.exe
55
dist/
6+
webex-mcp.dxt
7+
webex.skill
68

79
# Codegen intermediates
810
codegen/api_outline.json
@@ -24,3 +26,4 @@ Thumbs.db
2426
*.swp
2527
*.swo
2628
/docs/wxcc-search
29+
.webex-cli/

CLAUDE_DESKTOP.md

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# Webex MCP — Claude Desktop Setup
2+
3+
This guide covers installing and using the Webex MCP server with **Claude Desktop** specifically. For Claude Code (CLI), see the [main README](README.md).
4+
5+
## Requirements
6+
7+
- **Claude Desktop** — latest version
8+
- **Webex CLI** — installed and authenticated on each user's machine
9+
```bash
10+
# Install
11+
curl -fsSL https://raw.githubusercontent.com/Cloverhound/webex-cli/main/install.sh | sh
12+
13+
# Authenticate (opens browser for OAuth)
14+
webex login
15+
```
16+
- **Platform** — macOS, Windows, or Linux
17+
18+
The MCP server runs **locally** using stdio transport — no network port is opened and no shared server is required. Each user's own Webex credentials are used automatically.
19+
20+
---
21+
22+
## Installation
23+
24+
### Option 1 — Admin Portal (Team Distribution)
25+
26+
Admins can distribute the extension to the entire team without each user needing to install it manually.
27+
28+
1. Build the extension package:
29+
```bash
30+
git clone https://github.com/Cloverhound/webex-cli.git
31+
cd webex-cli
32+
make extension # produces webex-mcp.dxt
33+
```
34+
2. Upload `webex-mcp.dxt` to the [Claude admin portal](https://console.anthropic.com) under **Extensions**
35+
3. Enable it for your team or org
36+
4. Each team member must still install the Webex CLI and run `webex login` on their own machine
37+
38+
### Option 2 — Individual Install (Double-click)
39+
40+
Download or build `webex-mcp.dxt` and double-click it in Finder (macOS) or Explorer (Windows). Claude Desktop installs the extension automatically.
41+
42+
### Option 3 — HTTP Transport (Manual Config)
43+
44+
If you prefer HTTP transport instead of the DXT extension:
45+
46+
1. Start the MCP server:
47+
```bash
48+
webex mcp serve --http # binds to 127.0.0.1:47890
49+
webex mcp serve --http --http-addr 127.0.0.1:9000 # custom port
50+
```
51+
2. Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
52+
```json
53+
{
54+
"mcpServers": {
55+
"webex": { "url": "http://localhost:47890/mcp" }
56+
}
57+
}
58+
```
59+
3. Restart Claude Desktop
60+
4. Stop the server when done: `webex mcp stop`
61+
62+
The HTTP server only binds to loopback (`127.x.x.x`) and cannot be exposed on public interfaces.
63+
64+
---
65+
66+
## Tools
67+
68+
The extension exposes four tools:
69+
70+
| Tool | Maps to | Auto-approvable | Description |
71+
|---|---|---|---|
72+
| `webex_read` | GET | Yes | List, get, download, export, search — read-only operations |
73+
| `webex_write` | POST / PUT / PATCH / DELETE | No | Create, update, delete — always prompts for confirmation |
74+
| `webex_help` || Yes | Get help text and flag listings for any command |
75+
| `webex_usage` || Yes | View recent MCP command history with timing and status |
76+
77+
`webex_read`, `webex_help`, and `webex_usage` are safe to auto-approve. `webex_write` is intentionally kept separate so write operations always require explicit user confirmation.
78+
79+
---
80+
81+
## Adding the Skill for Better Results
82+
83+
The DXT extension provides Claude Desktop with the **tools** to execute Webex commands, but not the **knowledge** of how to use them optimally. Without the skill, Claude will use `webex_help` to discover commands on demand — functional, but slower and more prone to mistakes on edge cases like CC `--orgid` handling, pagination, and subcommand naming exceptions.
84+
85+
**The fix:** Use a Claude Desktop **Project** and paste the skill content into the Project instructions. This is the Claude Desktop equivalent of the Claude Code skill system.
86+
87+
### Setup
88+
89+
1. In Claude Desktop, create a new **Project** (e.g., "Webex Admin")
90+
2. Open **Project Instructions**
91+
3. Paste the contents of [`skill/SKILL.md`](skill/SKILL.md) — this covers auth, command structure, global flags, and best practices
92+
4. Optionally add the relevant sub-skill files for the areas your team uses most:
93+
94+
| Area | File | When to include |
95+
|---|---|---|
96+
| Admin | [`skill/admin/SKILL.md`](skill/admin/SKILL.md) | Managing people, licenses, orgs |
97+
| Calling | [`skill/calling/SKILL.md`](skill/calling/SKILL.md) | Locations, queues, devices, recordings |
98+
| Contact Center | [`skill/cc/SKILL.md`](skill/cc/SKILL.md) | Sites, flows, agents, entry points |
99+
| Devices | [`skill/device/SKILL.md`](skill/device/SKILL.md) | Device configs, workspaces, xAPI |
100+
| Meetings | [`skill/meetings/SKILL.md`](skill/meetings/SKILL.md) | Recordings, transcripts, scheduling |
101+
| Messaging | [`skill/messaging/SKILL.md`](skill/messaging/SKILL.md) | Rooms, messages, teams |
102+
103+
With the skill in Project instructions, Claude will know upfront about `--paginate`, RSQL filters, the CC `--orgid` auto-population, download patterns, and other behaviours that would otherwise require multiple `webex_help` round-trips to discover.
104+
105+
---
106+
107+
## Authentication
108+
109+
The extension uses the same credentials as the Webex CLI — run `webex login` once and the MCP server picks them up automatically. Token refresh is handled transparently.
110+
111+
```bash
112+
webex auth status # confirm you are logged in
113+
webex auth list # list all stored users
114+
webex auth switch <email> # change default user
115+
webex auth set-org <orgId> # set a persistent org override (partner admins)
116+
```
117+
118+
Multiple Webex accounts are supported. Switch the default user with `webex auth switch` and restart Claude Desktop (or `webex mcp stop` + re-open for HTTP transport).
119+
120+
---
121+
122+
## Troubleshooting
123+
124+
**"webex: command not found"**
125+
The install script adds `~/.local/bin` to PATH. If Claude Desktop launches before your shell profile is sourced, the binary may not be found. Fix by setting an absolute path in the extension config or ensuring `~/.local/bin` is in your system PATH (not just shell PATH).
126+
127+
For the HTTP transport option, edit `claude_desktop_config.json` to use an absolute path:
128+
```json
129+
{
130+
"mcpServers": {
131+
"webex": {
132+
"command": "/Users/yourname/.local/bin/webex",
133+
"args": ["mcp", "serve"]
134+
}
135+
}
136+
}
137+
```
138+
139+
**"No running MCP server found" (HTTP mode)**
140+
Run `webex mcp serve --http` before opening Claude Desktop, or switch to the DXT extension which starts the server automatically via stdio.
141+
142+
**Not authenticated**
143+
Run `webex login` in a terminal, then retry. Tokens are stored in the OS keyring and shared with the MCP server automatically.
144+
145+
**Wrong Webex org**
146+
Use `webex auth set-org <orgId>` to set a persistent org override, or pass `--organization <orgId>` on individual commands via the `flags` parameter.

Makefile

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: build download codegen refresh check clean
1+
.PHONY: build download codegen refresh check clean extension skill
22

33
build:
44
go build -o webex .
@@ -9,12 +9,27 @@ download:
99
codegen:
1010
cd codegen && python3 extract_api_spec.py
1111
cd codegen && python3 generate_cli.py
12+
cd codegen && python3 generate_skills.py
1213

1314
refresh: download codegen build
1415

1516
check: build
1617
go vet ./...
1718

19+
extension: build
20+
cd extension && zip -r ../webex-mcp.dxt manifest.json icon.png
21+
@echo "Built webex-mcp.dxt"
22+
23+
skill:
24+
@python3 -c "\
25+
import zipfile; \
26+
z = zipfile.ZipFile('webex.skill', 'w', zipfile.ZIP_DEFLATED); \
27+
z.write('skill/SKILL.md', 'webex-cli/SKILL.md'); \
28+
resources = ['admin','calling','cc','device','meetings','messaging']; \
29+
[z.write(f'skill/{r}/SKILL.md', f'webex-cli/resources/{r}.md') for r in resources]; \
30+
z.close()"
31+
@echo "Built webex.skill"
32+
1833
clean:
19-
rm -f webex webex-cli
34+
rm -f webex webex-cli webex-mcp.dxt webex.skill
2035
rm -f codegen/api_spec.json codegen/api_outline.json

README.md

Lines changed: 86 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ webex login
2727
# Webex Calling
2828
webex calling people list --max 10
2929
webex calling locations list
30-
webex calling call-queue list
30+
webex calling call-queue list-cxe
3131

3232
# Contact Center
3333
webex cc site list
3434
webex cc team list
35-
webex cc agents list
35+
webex cc contact-service-queue list
3636
webex cc entry-point list
3737

3838
# Admin
@@ -91,23 +91,23 @@ All upload commands support `--dry-run` to preview the request without sending i
9191

9292
### Calling (`webex calling`)
9393

94-
45 resource groups including auto-attendants, call queues, hunt groups, call controls, call routing (dial plans, route groups, trunks), DECT devices, emergency services, locations, numbers, paging groups, people, workspaces, voicemail, recordings, and more.
94+
47 resource groups including auto-attendants, call queues (CxE), hunt groups, call controls, call routing (dial plans, route groups, trunks), DECT devices, emergency services, locations, numbers, paging groups, people, workspaces, voicemail, converged recordings, and more.
9595

9696
### Contact Center (`webex cc`)
9797

98-
54 resource groups including agents, queues, entry points, flows, skills, desktop layouts, campaigns, callbacks, realtime stats, AI assistant, journey analytics, subscriptions, and more.
98+
54 resource groups including sites, queues, entry points, teams, flows, skills, desktop layouts, global variables, business hours, auxiliary codes, campaigns, callbacks, realtime stats, AI assistant, journey analytics, subscriptions, and more.
9999

100100
### Admin (`webex admin`)
101101

102102
39 resource groups including people, licenses, organizations, roles, groups, events, reports, recordings, SCIM 2.0 (users/groups/schemas), hybrid clusters/connectors, security audit, service apps, and more.
103103

104104
### Devices (`webex device`)
105105

106-
9 resource groups including devices, device configurations, workspaces, workspace locations/metrics/personalization, hot-desking, and xAPI (execute commands, query status).
106+
10 resource groups including devices, device configurations, workspaces, workspace locations/metrics/personalization, hot-desking, and xAPI (execute commands, query status).
107107

108108
### Meetings (`webex meetings`)
109109

110-
22 resource groups including meetings, participants, recordings, transcripts, summaries, polls, Q&A, chats, invitees, preferences, session types, tracking codes, video mesh, and more.
110+
23 resource groups including meetings, participants, recordings, transcripts, summaries, polls, Q&A, chats, invitees, preferences, session types, tracking codes, video mesh, and more.
111111

112112
### Messaging (`webex messaging`)
113113

@@ -166,7 +166,7 @@ Control output with `--output`:
166166

167167
```bash
168168
webex calling people list --output table
169-
webex cc agents list --output csv > agents.csv
169+
webex cc users list --output csv > users.csv
170170
```
171171

172172
## Global Flags
@@ -192,19 +192,95 @@ webex config get client-id # View current value
192192

193193
Config is stored in `~/.webex-cli/config.json`.
194194

195+
## MCP Server
196+
197+
> **Claude Desktop users:** see [CLAUDE_DESKTOP.md](CLAUDE_DESKTOP.md) for installation, DXT extension setup, and skill configuration specific to Claude Desktop.
198+
199+
200+
`webex mcp serve` starts a [Model Context Protocol](https://modelcontextprotocol.io/) server over stdio, letting AI clients query and manage your Webex environment directly.
201+
202+
```bash
203+
# Register with Claude Code
204+
claude mcp add webex -- webex mcp serve
205+
206+
# Or register with a specific binary path
207+
claude mcp add webex -- /path/to/webex mcp serve
208+
```
209+
210+
The server exposes 4 tools:
211+
212+
| Tool | API methods | Description |
213+
|---|---|---|
214+
| `webex_read` | GET | Execute a read-only CLI command (list, get, download, export, search) |
215+
| `webex_write` | POST / PUT / PATCH / DELETE | Execute a command that creates, updates, or deletes a resource |
216+
| `webex_help` || Get help text for any command or command group |
217+
| `webex_usage` || Query the MCP usage log (recent commands, timing, status) |
218+
219+
Read and write operations are split into separate tools so that `webex_read` can be auto-approved in permissions while `webex_write` always prompts for confirmation.
220+
221+
And 2 MCP resources:
222+
223+
| Resource | Description |
224+
|---|---|
225+
| `webex://commands` | JSON array of all available CLI commands with short descriptions |
226+
| `webex://usage` | Last 50 raw lines of the usage log |
227+
228+
Rather than exposing fixed per-API tools, the dispatcher pattern lets AI clients invoke the full CLI surface via `webex_run` — the command tree expands automatically as new commands are added.
229+
230+
Auth is shared with the CLI — run `webex login` once and the MCP server uses the same stored credentials. Token refresh is handled automatically.
231+
232+
### Usage Log
233+
234+
All `webex_run` invocations are logged to `~/.webex-mcp/usage.log` (JSONL). Configure with serve flags:
235+
236+
```bash
237+
webex mcp serve --log-path /tmp/webex.log --log-max-size 10485760 --log-max-files 5
238+
```
239+
240+
| Flag | Default | Description |
241+
|---|---|---|
242+
| `--log-path` | `~/.webex-mcp/usage.log` | Log file path |
243+
| `--log-max-size` | `5242880` (5 MB) | Max file size before rotation |
244+
| `--log-max-files` | `3` | Number of rotated files to keep |
245+
246+
### Team Distribution via Claude Admin Portal
247+
248+
Package the extension once and upload it to the Claude admin console — Claude Desktop installs it automatically for all team members. Each user's local `webex` installation and credentials are used; no shared server is needed.
249+
250+
```bash
251+
make extension # produces webex-mcp.dxt
252+
```
253+
254+
1. Upload `webex-mcp.dxt` to the Claude admin portal under **Extensions**
255+
2. Enable it for your team or org
256+
3. Team members must have `webex` installed and authenticated (`webex login`)
257+
258+
Alternatively, team members can install the extension locally by double-clicking `webex-mcp.dxt` in Finder.
259+
195260
## Coding Agent Skill
196261

197-
A skill file is included in `skill/SKILL.md` that enables AI coding agents (Claude Code, Claude Cowork, OpenAI Codex, Cursor) to query and manage your Webex environment.
262+
A set of skill files in `skill/` enables AI coding agents (Claude Code, Claude Cowork, OpenAI Codex, Cursor) to use the CLI via natural language. The root skill (`skill/SKILL.md`) covers auth, command structure, and global flags. Six per-area sub-skills provide comprehensive flag and body-schema documentation for each CLI area:
263+
264+
| Area | Sub-skill |
265+
|---|---|
266+
| Admin | `skill/admin/SKILL.md` |
267+
| Calling | `skill/calling/SKILL.md` |
268+
| Contact Center | `skill/cc/SKILL.md` |
269+
| Devices | `skill/device/SKILL.md` |
270+
| Meetings | `skill/meetings/SKILL.md` |
271+
| Messaging | `skill/messaging/SKILL.md` |
272+
273+
Each sub-skill also contains an auto-generated **Command Reference** section (updated by `make codegen`) that lists every command and its flags, keeping documentation in sync with the API as Postman collections change.
198274

199-
The installer and `webex post-install` command will offer to install the skill automatically. Skills are also kept up to date when you run `webex update`.
275+
`webex post-install` offers to install all skill files automatically. They are also updated by `webex update`.
200276

201277
See the [docs](https://cloverhound.github.io/webex-cli/agent-skill/) for manual setup instructions.
202278

203279
## Development
204280

205281
See [CLAUDE.md](CLAUDE.md) for project structure and development workflow.
206282

207-
Commands in `cmd/calling/` and `cmd/cc/` are **generated** from Postman collections — do not edit by hand. See the [code generation pipeline](CLAUDE.md#code-generation-pipeline) for details.
283+
Commands in `cmd/calling/`, `cmd/cc/`, and the other area packages are **generated** from Postman collections — do not edit by hand. Run `make refresh` to re-download collections, regenerate Go files, update skill documentation, and rebuild. See the [code generation pipeline](CLAUDE.md#code-generation-pipeline) for details.
208284

209285
## License
210286

Webex--Cloverhound-Icons.svg

Lines changed: 8 additions & 0 deletions
Loading

cmd/admin/events.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)