@thedesignagent/mcp 0.2.0 → 0.2.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 +109 -0
- package/dist/index.js +1 -1
- package/package.json +12 -1
package/README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# @thedesignagent/mcp
|
|
2
|
+
|
|
3
|
+
MCP server for [TheDesignAgent](https://thedesignagent.ai): UX and visual judgment for UI that coding agents build.
|
|
4
|
+
|
|
5
|
+
Your agent gets a build brief before it builds a screen, and a scored review after: does the screen serve the user's job, does it follow UX heuristics, does it match your design system. Reviews use a real screenshot when the page is running.
|
|
6
|
+
|
|
7
|
+
Works with any MCP client: Claude Code, Codex, Cursor, Grok Build, Claude Desktop and others.
|
|
8
|
+
|
|
9
|
+
## Tools
|
|
10
|
+
|
|
11
|
+
| Tool | When | What it returns |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| `discover` | Before building a screen | A ~600-token build brief: the user's job, heuristics to apply, patterns, design tokens |
|
|
14
|
+
| `ux` | After building | 0–10 score for heuristics, cognitive load, pattern conformance and job fit, with findings and fixes |
|
|
15
|
+
| `visual` | After building | 0–10 score for brand compliance, visual hierarchy and aesthetics, from a screenshot when you pass `render_url` |
|
|
16
|
+
|
|
17
|
+
Project context is stored server-side and improves with every call: anti-patterns found in one review shape the next brief.
|
|
18
|
+
|
|
19
|
+
## Setup
|
|
20
|
+
|
|
21
|
+
Get an API key at [thedesignagent.ai/dashboard/api-keys](https://thedesignagent.ai/dashboard/api-keys). The free plan includes 100 calls a month.
|
|
22
|
+
|
|
23
|
+
Requires Node.js 20 or later.
|
|
24
|
+
|
|
25
|
+
### Claude Code (recommended: the plugin)
|
|
26
|
+
|
|
27
|
+
The plugin adds skills that teach the agent the brief → build → review loop, plus `/thedesignagent:brief` and `/thedesignagent:review` commands:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
/plugin marketplace add CMBurnett/the-design-agent-plugin
|
|
31
|
+
/plugin install thedesignagent@thedesignagent
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Or add the server on its own:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
claude mcp add thedesignagent -e THEDESIGNAGENT_API_KEY=sk_... -- npx -y --package=@thedesignagent/mcp thedesignagent-mcp
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Codex
|
|
41
|
+
|
|
42
|
+
In `~/.codex/config.toml`:
|
|
43
|
+
|
|
44
|
+
```toml
|
|
45
|
+
[mcp_servers.thedesignagent]
|
|
46
|
+
command = "npx"
|
|
47
|
+
args = ["-y", "--package=@thedesignagent/mcp", "thedesignagent-mcp"]
|
|
48
|
+
env = { THEDESIGNAGENT_API_KEY = "sk_..." }
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Cursor, Claude Desktop and other JSON-configured clients
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"mcpServers": {
|
|
56
|
+
"thedesignagent": {
|
|
57
|
+
"command": "npx",
|
|
58
|
+
"args": ["-y", "--package=@thedesignagent/mcp", "thedesignagent-mcp"],
|
|
59
|
+
"env": { "THEDESIGNAGENT_API_KEY": "sk_..." }
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The package has two commands, so pass `--package` and name `thedesignagent-mcp` as shown. A bare `npx @thedesignagent/mcp` won't start.
|
|
66
|
+
|
|
67
|
+
## How agents use it
|
|
68
|
+
|
|
69
|
+
1. **Identify the project.** Pass `project_id` from a `.thedesignagent` file in the repo root, or `repo_hash` (SHA-256 of the git remote URL) if there isn't one yet.
|
|
70
|
+
2. **Call `discover`** with the screen you're about to build. On a project's first call it returns `needs_setup` with an extraction task: the agent scans the repo, builds a project model and calls again. After that, briefs come back immediately.
|
|
71
|
+
3. **Build** following the brief.
|
|
72
|
+
4. **Call `ux` and `visual`** with the built code as `artifact`. Pass `render_url` (for example `http://localhost:3000/checkout`) to `visual` for a screenshot-based review.
|
|
73
|
+
5. **Fix** critical and high findings, then re-check once.
|
|
74
|
+
|
|
75
|
+
After the first successful `discover`, write `{ "project_id": "<id>" }` to `.thedesignagent` and commit it, so every agent on the repo shares the same project context.
|
|
76
|
+
|
|
77
|
+
## Screenshots
|
|
78
|
+
|
|
79
|
+
`visual` screenshots `render_url` with your local Chrome, Edge, Brave or Chromium. If it can't find one, set `CHROME_PATH` to the browser binary.
|
|
80
|
+
|
|
81
|
+
Screenshots are saved to `~/.thedesignagent/screenshots/` for 24 hours, so you can see exactly what was reviewed.
|
|
82
|
+
|
|
83
|
+
### Pages behind login
|
|
84
|
+
|
|
85
|
+
Capture a logged-in session once per app:
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
npx -y --package=@thedesignagent/mcp thedesignagent-auth capture http://localhost:3000
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
A browser opens; log in, then press Enter (or close the browser). The session is saved under `~/.thedesignagent/auth/` and reused for that origin. When `visual` hits a login redirect, it tells the agent to ask you to run this command.
|
|
92
|
+
|
|
93
|
+
## Environment variables
|
|
94
|
+
|
|
95
|
+
| Variable | Required | Purpose |
|
|
96
|
+
| --- | --- | --- |
|
|
97
|
+
| `THEDESIGNAGENT_API_KEY` | Yes | Your `sk_` API key |
|
|
98
|
+
| `CHROME_PATH` | No | Browser binary for screenshots, if it isn't found automatically |
|
|
99
|
+
| `ANTHROPIC_API_KEY` | No | Enables a fallback review through Claude when TheDesignAgent's API is unreachable |
|
|
100
|
+
|
|
101
|
+
## Limits and errors
|
|
102
|
+
|
|
103
|
+
- Each plan has a monthly call limit. When you reach it, calls return a limit message; upgrade at [thedesignagent.ai](https://thedesignagent.ai) or wait for the monthly reset.
|
|
104
|
+
- An authentication error means the API key is missing, wrong or revoked.
|
|
105
|
+
|
|
106
|
+
## Links
|
|
107
|
+
|
|
108
|
+
- Website: [thedesignagent.ai](https://thedesignagent.ai)
|
|
109
|
+
- Claude Code plugin: [CMBurnett/the-design-agent-plugin](https://github.com/CMBurnett/the-design-agent-plugin)
|
package/dist/index.js
CHANGED
|
@@ -510,7 +510,7 @@ const evalInputSchema = {
|
|
|
510
510
|
repo_hash: z.string().optional().describe('SHA256 of git remote origin URL (fallback if no .thedesignagent)'),
|
|
511
511
|
codebase_context: z.string().optional().describe('Optional surrounding code context'),
|
|
512
512
|
};
|
|
513
|
-
const server = new McpServer({ name: 'TheDesignAgent', version: '0.2.
|
|
513
|
+
const server = new McpServer({ name: 'TheDesignAgent', version: '0.2.1' });
|
|
514
514
|
server.registerTool('discover', {
|
|
515
515
|
description: `Get a build brief calibrated to your project, persona, and the specific screen you're building.
|
|
516
516
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thedesignagent/mcp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "MCP server for TheDesignAgent — UX and visual judgment layer for agent-generated UI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://thedesignagent.ai",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"mcp",
|
|
9
|
+
"model-context-protocol",
|
|
10
|
+
"design",
|
|
11
|
+
"ux",
|
|
12
|
+
"ui-review",
|
|
13
|
+
"design-system",
|
|
14
|
+
"claude-code",
|
|
15
|
+
"codex",
|
|
16
|
+
"ai-agents"
|
|
17
|
+
],
|
|
7
18
|
"bin": {
|
|
8
19
|
"thedesignagent-mcp": "./dist/index.js",
|
|
9
20
|
"thedesignagent-auth": "./dist/auth-capture.js"
|