@director.run/cli 0.3.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,151 +1,305 @@
1
1
  <h1 align="center">Director</h1>
2
- <p align="center">The easiest way to use MCP.</p>
2
+ <p align="center">MCP Playbooks for AI agents</p>
3
3
 
4
4
  <p align="center"><code>curl -LsSf https://director.run/install.sh | sh</code></p>
5
5
 
6
6
  ---
7
7
 
8
- [Director](https://director.run) is open source MCP middleware that acts as a proxy between models/agents and MCP servers. Supporting all MCP transports natively, it aggregates tools, prompts, and resources server-side while providing a unified client-side integration point. This abstraction eliminates MCP server management overhead, enabling developers to focus on prompt engineering and domain logic rather than infrastructure complexity. If you'd like to learn more about director, please read the [documentation](https://docs.director.run)
8
+ <div align="center">
9
9
 
10
- > **Note:** This project is under active development and is not yet stable & may contain bugs. Please see our [contributing](https://docs.director.run/project/contributing) if you'd like to help.
10
+ [![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
11
+ [![ci](https://github.com/director-run/director/workflows/CI/badge.svg)](https://github.com/director-run/director/actions/workflows/ci.yml)
12
+ [![Release](https://github.com/director-run/director/workflows/Release/badge.svg)](https://github.com/director-run/director/actions/workflows/release.yml)
13
+ [![npm](https://img.shields.io/npm/v/@director.run/cli.svg)](https://www.npmjs.com/package/@director.run/cli)
11
14
 
12
- ## Prerequisites
15
+ </div>
13
16
 
14
- - Tested on MacOS (Sequoia 15.5) and Ubuntu (24.04.2 LTS)
15
- - [Node.js](https://nodejs.org/en/download) (tested on v23.7.0)
16
- - [UV](https://docs.astral.sh/uv/getting-started/installation/) for many Stdio servers
17
- - [Claude](https://claude.ai/download), [Cursor](https://www.cursor.com/downloads) or [VSCode](https://code.visualstudio.com/download) installed. (if you'd like director to configure them automatically).
17
+ # Overview
18
18
 
19
+ Director allows you to provide <ins>**playbooks**</ins> to AI Agents. A playbook is a set of <ins>**MCP tools**</ins>, <ins>**prompts**</ins> and <ins>**configuration**</ins>, that give agents new <ins>**skills**</ins>. You can connect Claude, Cursor and VSCode in 1-click, or integrate manually through a single MCP endpoint.
19
20
 
20
- ## Quickstart
21
+ Playbooks are portable, declarative YAML files that can easily be shared (or committed to version control). Director is local-first - installation and client integration takes 30 seconds. In addition, Director provides all of the MCP management functionality that you'd expect: tool filtering, logging, strong isolation, and unified OAuth.
21
22
 
22
- The fastest way to try out director is by running the quickstart directly using npx. This will start the director gateway and open the UI.
23
+ <br />
24
+
25
+ [![Watch the video](https://image.mux.com/LkXOkiGsfatE6XLxda8ZEm02ydvxJ1K004y5EgqYV7dus/thumbnail.png?time=60)](https://player.mux.com/LkXOkiGsfatE6XLxda8ZEm02ydvxJ1K004y5EgqYV7dus)
23
26
 
24
- ```bash
25
- curl -LsSf https://director.run/install.sh | sh
26
- director quickstart
27
- ```
28
27
 
29
- #### Installing Manually
28
+ ## Key Features
30
29
 
31
- If you'd like to install director manually, you can do so via `npm` once you've installed the Prerequisites.
30
+ - 📚 **Playbooks** - Maintain sets of tools, prompts and config for different tasks or environments.
31
+ - 🚀 **1-Click Integration** - Switch playbooks with a single click. Currently supports Claude Code, Claude Desktop, Cursor, VSCode
32
+ - 🔗 **Shareable** - Playbooks are flat files which can be shared or committed to version control easily.
33
+ - 🏠 **Local-First** - Director is local-first, designed to easily run on your own machine or infrastructure.
34
+ - 🔑 **Unified OAuth** - Connect to OAuth MCPs centrally, and use them across all of your agents.
35
+ - 🎯 **Tool Filtering** - Select only the MCP tools that are required for the specific task, preserving context.
36
+ - 📋 **Declarative** - Like terraform for AI agents, Director will enforce playbook to client mapping on startup.
37
+ - 🔧 **Flexibility** - You can configure director through the UI, by editing the config file, through the CLI or even using the Typescript SDK.
38
+ - 📊 **Observability** - Centralized JSON logging, that allows you to understand exactly what your agent is doing.
39
+ - 🔌 **MCP Compliant** - Just works with any MCP server or client. Up to date with the latest MCP spec.
40
+
41
+ # Quickstart
32
42
 
33
43
  ```bash
34
- npm install -g @director.run/cli
35
- director serve # start the gateway
36
- director studio # open the studio in your browser
44
+ # Install Director
45
+ $ curl -LsSf https://director.run/install.sh | sh
46
+
47
+ # Start the onboarding flow
48
+ $ director quickstart
37
49
  ```
38
50
 
39
- #### Docker (Experimental)
51
+ # Core Concepts
52
+
53
+ ## Playbooks
54
+
55
+ A playbook is a set of tools, prompts and configuration, used to provide specific capabilities to your agent. Under the hood, playbooks are built on top of the MCP tools & prompts primitives.
56
+
57
+ The easiest way to author a playbook is via the UI (`director studio`). But you can also use the CLI or write the config manually (see below). You can have many playbooks, typically one per task or per environment. Connecting them is one click in the UI (or one CLI command / config entry), connections are enforced on startup.
58
+
59
+ ```yaml
60
+ #
61
+ # Client <> Playbook mappings (enforced on startup)
62
+ #
63
+ clients:
64
+ claude-code: [ production-support ]
65
+ cursor: [ production-support ]
66
+
67
+ #
68
+ # Playbooks
69
+ #
70
+ playbooks:
71
+ - id: production-support
72
+ name: Production Support
73
+ description: Investigate and resolve production issues
74
+ #
75
+ # MCP Servers / Tools
76
+ #
77
+ servers:
78
+ # Get alerts
79
+ - name: sentry
80
+ type: http
81
+ url: https://mcp.sentry.dev/mcp
82
+
83
+ # Read the logs
84
+ - name: cloudwatch
85
+ type: stdio
86
+ command: uvx
87
+ args: ["awslabs.cloudwatch-mcp-server@latest"]
88
+ env:
89
+ AWS_PROFILE: "[The AWS Profile Name to use for AWS access]",
90
+ include: [search_logs, get_metrics] # No write access
91
+
92
+ # Write back to the repository
93
+ - name: github
94
+ type: http
95
+ url: https://api.githubcopilot.com/mcp/
96
+ tools:
97
+ include: [ create_pr, search_code ]
98
+ #
99
+ # Prompts
100
+ #
101
+ prompts:
102
+ - name: investigate
103
+ content: |
104
+ Check recent alerts, correlate with deployment times,
105
+ search logs for errors, identify root cause
106
+ ```
107
+
108
+ ## Architecture
109
+
110
+ At a high level, Director is a service that sits between your agents and MCP servers. It's transparent to clients, requiring no additional tokens. It models playbooks, which can be thought of as standalone, portable skills that enhance your AI agent with new capabilities.
111
+
112
+ <img src="https://github.com/director-run/director/blob/main/apps/docs/images/director-highlevel-overview.webp" width="100%" alt="director demo">
40
113
 
41
- If you'd like to run director (and all the MCP servers) inside a docker container, you can use the following command. Please note that this functionality is experimental
114
+ # Usage
42
115
 
116
+ ## Installation
43
117
  ```bash
44
- # Start the gateway container, listening on port 8080
45
- # Mount the data directory to persist the gateway's state (config files, etc)
46
- docker run \
47
- -d -p 8080:8080 \
48
- -v ./data:/root/.director \
49
- --name director \
50
- barnaby/director:latest
51
-
52
- # Tail the logs
53
- docker logs -f director
54
-
55
- # Interact with the gateway using the CLI, on the host machine
56
- npm install -g @director.run/cli
57
- GATEWAY_URL=http://localhost:8080 director create my-proxy
58
- GATEWAY_URL=http://localhost:8080 director add my-proxy --entry fetch
59
- ```
118
+ # Install the director CLI + dependencies (node, npm & uvx) via the 1-liner:
119
+ $ curl -LsSf https://director.run/install.sh | sh
60
120
 
61
- ## CLI Examples
121
+ # Alternatively, install through npm:
122
+ $ npm install -g @director.run/cli
62
123
 
124
+ # Start director & open the UI
125
+ $ director quickstart
126
+ ```
63
127
 
128
+ ## The Studio (Web UI)
64
129
 
65
- ## Start the gateway
130
+ The simplest way to interact with director is via the admin interface:
66
131
 
67
132
  ```bash
68
- $ director serve
133
+ # Open studio in your browser
134
+ $ director studio
135
+ ```
69
136
 
70
- _ _ _
71
- | (_) | |
72
- __| |_ _ __ ___ ___| |_ ___ _ __
73
- / _' | | '__/ _ \/ __| __/ _ \| '__|
74
- | (_| | | | | __/ (__| || (_) | |
75
- \__,_|_|_| \___|\___|\__\___/|_|
137
+ ## CLI Reference
76
138
 
139
+ ```bash
140
+ Playbooks for your AI agent
141
+
142
+ USAGE
143
+ director <command> [subcommand] [flags]
144
+
145
+ CORE COMMANDS
146
+ quickstart Start the gateway and open the studio in your browser
147
+ serve Start the web service
148
+ studio Open the UI in your browser
149
+ ls List playbooks
150
+ get <playbookId> [serverName] Show playbook details
151
+ auth <playbookId> <server> Authenticate a server
152
+ create <name> Create a new playbook
153
+ destroy <playbookId> Delete a playbook
154
+ connect <playbookId> [options] Connect a playbook to a MCP client
155
+ disconnect <playbookId> [options] Disconnect a playbook from an MCP client
156
+ add <playbookId> [options] Add a server to a playbook.
157
+ remove <playbookId> <serverName> Remove a server from a playbook
158
+ update <playbookId> [serverName] [options] Update playbook attributes
159
+ http2stdio <url> Proxy an HTTP connection (sse or streamable) to a stdio stream
160
+ env [options] Print environment variables
161
+ status Get the status of the director
162
+
163
+ REGISTRY
164
+ registry ls List all available servers in the registry
165
+ registry get <entryName> Get detailed information about a registry item
166
+ registry readme <entryName> Print the readme for a registry item
167
+
168
+ MCP
169
+ mcp list-tools <playbookId> List tools on a playbook
170
+ mcp get-tool <playbookId> <toolName> Get the details of a tool
171
+ mcp call-tool <playbookId> <toolName> [options] Call a tool on a playbook
172
+
173
+ PROMPTS
174
+ prompts ls <playbookId> List all prompts for a playbook
175
+ prompts add <playbookId> Add a new prompt to a playbook
176
+ prompts edit <playbookId> <promptName> Edit an existing prompt
177
+ prompts remove <playbookId> <promptName> Remove a prompt from a playbook
178
+ prompts get <playbookId> <promptName> Show the details of a specific prompt
179
+
180
+ FLAGS
181
+ -V, --version output the version number
182
+
183
+ EXAMPLES
184
+ $ director create my-playbook # Create a new playbook
185
+ $ director add my-playbook --entry fetch # Add a server to a playbook
186
+ $ director connect my-playbook --target claude # Connect my-playbook to claude
77
187
 
78
- [18:16:21] INFO (Gateway): starting director gateway
79
- [18:16:21] INFO (Gateway): director gateway running on port 3673
80
188
  ```
81
189
 
82
- ## Create a proxy
83
- ```bash
84
- $ director create my-first-proxy
85
- proxy my-first-proxy created
190
+ ## Configuration File Reference
191
+
192
+ ```yaml
193
+ #
194
+ # Server config
195
+ #
196
+ server:
197
+ port: 1234
198
+
199
+ #
200
+ # Client Connections
201
+ #
202
+ clients:
203
+ claude-code: [ code_review ] # connect claude code to the code_review playbook
204
+
205
+ #
206
+ # Playbooks
207
+ #
208
+ playbooks:
209
+ - name: code_review
210
+ description: Automates code reviews
211
+ servers:
212
+ - name: filesystem
213
+ type: stdio
214
+ command: npx
215
+ args: [ "@modelcontextprotocol/server-filesystem", "./src" ]
216
+
217
+ - name: github
218
+ type: http
219
+ url: https://api.githubcopilot.com/mcp/
220
+ tools:
221
+ # include only these tools
222
+ include: [ create_issue, search_code ]
223
+
224
+ # invoke with slash commands
225
+ prompts:
226
+ - name: code_review
227
+ content: "Review this code for security vulnerabilities and performance issues"
228
+
229
+ - name: write_tests
230
+ content: "Write comprehensive unit tests including edge cases"
86
231
  ```
87
232
 
88
- ## Add a server to the proxy
89
- ```bash
90
- $ director add my-first-proxy --entry hackernews
91
- adding hackernews to my-first-proxy
92
- ✔ Entry fetched.
93
- Registry entry hackernews added to my-first-proxy
233
+ ### TypeScript SDK
234
+
235
+ Programmatic control for advanced use cases:
236
+
237
+ ```typescript
238
+ import { Director } from '@director.run/sdk';
239
+
240
+ const director = new Director();
241
+
242
+ // Create playbook programmatically
243
+ const playbook = await director.playbooks.create({
244
+ name: 'ci-environment',
245
+ servers: [{
246
+ name: 'github',
247
+ command: 'mcp-server-github',
248
+ env: { GITHUB_TOKEN: process.env.GITHUB_TOKEN }
249
+ }]
250
+ });
251
+
252
+ // Execute tools
253
+ const result = await playbook.callTool('github.create_issue', {
254
+ title: 'Automated issue from CI',
255
+ body: 'This issue was created by Director'
256
+ });
94
257
  ```
95
258
 
96
- ## Connect the proxy to a client
259
+ # Repository Structure
260
+
261
+ ### External Apps
262
+
263
+ - [`apps/cli`](./apps/cli/README.md) - The command-line interface, the primary way to interact with Director. Available on [npm](https://www.npmjs.com/package/@director.run/cli).
264
+ - [`apps/sdk`](./apps/sdk/README.md) - The Typescript SDK, available on [npm](https://www.npmjs.com/package/@director.run/sdk).
265
+ - [`apps/docker`](./apps/docker/README.md) - The Director docker image, which allows you to run Director (and all MCP servers) securely inside a container. Available on [Docker Hub](https://hub.docker.com/r/barnaby/director).
266
+ - [`apps/docs`](./apps/docs/README.md) - Project documentation hosted at [https://docs.director.run](https://docs.director.run)
267
+ - [`apps/registry`](./apps/registry/README.md) - Backend for the registry hosted at [https://registry.director.run](https://registry.director.run)
268
+ - [`apps/sandbox`](./apps/sandbox/README.md) - A tool for running Director (and all MCP servers) securely inside a VM. Apple Silicon only.
269
+ - [`apps/studio`](./apps/studio/README.md) - Director frontend application
270
+
271
+ ### Internal Packages
272
+
273
+ - [`packages/client-configurator`](./packages/client-configurator/README.md) - Library for managing MCP client configuration files
274
+ - [`packages/gateway`](./packages/gateway/README.md) - Core gateway and playbook logic
275
+ - [`packages/mcp`](./packages/mcp/README.md) - Extensions to MCP SDK that add middleware functionality
276
+ - [`packages/utilities`](./packages/utilities/README.md) - Shared utilities used across all packages and apps
277
+ - [`packages/design`](./packages/design/README.md) - Design system: reusable UI components, hooks, and styles for all Director apps
278
+
279
+ *This is a monorepo managed by [Turborepo](https://turbo.build/).*
280
+
281
+ # Community
282
+
283
+ If you're using director, have any ideas, or just want to chat about MCP, we'd love to chat:
284
+ - 💬 Join our [Discord](https://discord.gg/kWZGvWks)
285
+ - 📧 Send us an [Email](mailto:hello@director.run)
286
+ - 🐛 Report a [Bug](https://github.com/director-run/director/issues)
287
+ - 🐦 Follow us on [X / Twitter](https://x.com/barnabymalet)
288
+
289
+ # Contributing
290
+
291
+ We welcome contributions! See [CONTRIBUTING.mdx](./apps/docs/project/contributing.mdx) for guidelines.
292
+
293
+ ## Setting up Development Environment
294
+
97
295
  ```bash
98
- # connect the proxy to Claude automatically
99
- $ director connect my-first-proxy -t claude
100
- [18:19:06] INFO (client-configurator/claude): reading config from /Users/barnaby/Library/Application Support/Claude/claude_desktop_config.json
101
- [18:19:06] INFO (client-configurator/claude): installing my-first-proxy
102
- [18:19:06] INFO (client-configurator/claude): writing config to /Users/barnaby/Library/Application Support/Claude/claude_desktop_config.json
103
- [18:19:06] INFO (client-configurator/claude): restarting claude
104
- [18:19:06] INFO (restartApp): restarting Claude...
105
- [18:19:08] INFO (restartApp): Claude has been restarted
106
- undefined
107
-
108
- # print the manual connection details
109
- $ director connect my-first-proxy
110
-
111
- --------------------------------
112
- Connection Details for 'my-first-proxy'
113
- --------------------------------
114
-
115
- Note: if you'd like to connect to a client automatically, run:
116
- director connect my-first-proxy --target <target>
117
-
118
- HTTP Streamable: http://localhost:3673/my-first-proxy/mcp
119
- HTTP SSE: http://localhost:3673/my-first-proxy/sse
120
- Stdio: {
121
- "command": "npx",
122
- "args": [
123
- "-y",
124
- "@director.run/cli",
125
- "http2stdio",
126
- "http://localhost:3673/my-first-proxy/mcp"
127
- ],
128
- "env": {
129
- "LOG_LEVEL": "silent"
130
- }
131
- }
296
+ # Fork and clone
297
+ git clone https://github.com/director_run/director
298
+ cd director
299
+ ./scripts/setup-development.sh
300
+ bun run test
132
301
  ```
133
302
 
134
- ## Get the details of a proxy
135
- ```bash
136
- # list all the proxies
137
- $ director ls
138
- ┌────────────────┬────────────────┬──────────────────────────────────────────┐
139
- │ id │ name │ path │
140
- │ my-first-proxy │ my-first-proxy │ http://localhost:3673/my-first-proxy/mcp │
141
- └────────────────┴────────────────┴──────────────────────────────────────────┘
142
-
143
- # get the details of a single proxy
144
- $ director get my-first-proxy
145
- id=my-first-proxy
146
- name=my-first-proxy
147
- ┌───────┬───────────┬──────────────────────┐
148
- │ name │ transport │ url/command │
149
- │ fetch │ stdio │ uvx mcp-server-fetch │
150
- └───────┴───────────┴──────────────────────┘
151
- ```
303
+ # License
304
+
305
+ AGPL v3 - See [LICENSE](./LICENSE) for details.