@wireweave/mcp-server 1.8.0 → 1.8.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.
Files changed (3) hide show
  1. package/README.md +43 -122
  2. package/dist/index.js +614 -795
  3. package/package.json +39 -14
package/README.md CHANGED
@@ -1,45 +1,39 @@
1
- <p align="center">
2
- <img src="https://raw.githubusercontent.com/wireweave/mcp-server/main/logo.svg" width="128" height="128" alt="Wireweave MCP">
3
- </p>
1
+ # @wireweave/mcp-server
4
2
 
5
- <h1 align="center">@wireweave/mcp-server</h1>
3
+ A Model Context Protocol (MCP) server that exposes the Wireweave wireframe DSL to MCP clients like Claude Desktop and Cursor.
6
4
 
7
- <p align="center">
8
- <a href="https://www.npmjs.com/package/@wireweave/mcp-server"><img src="https://img.shields.io/npm/v/@wireweave/mcp-server.svg" alt="npm version"></a>
9
- <a href="https://github.com/wireweave/mcp-server/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@wireweave/mcp-server.svg" alt="license"></a>
10
- <a href="https://www.npmjs.com/package/@wireweave/mcp-server"><img src="https://img.shields.io/npm/dm/@wireweave/mcp-server.svg" alt="npm downloads"></a>
11
- <a href="https://lobehub.com/mcp/wireweave-mcp-server"><img src="https://lobehub.com/badge/mcp/wireweave-mcp-server" alt="LobeHub MCP"></a>
12
- <a href="https://mcpserverhub.com"><img src="https://img.shields.io/badge/MCP-Server%20Hub-blue" alt="MCP Server Hub"></a>
13
- <a href="https://modelcontextprotocol.io"><img src="https://img.shields.io/badge/MCP-Compatible-green" alt="MCP Compatible"></a>
14
- </p>
5
+ ## What it does
15
6
 
16
- <p align="center">Model Context Protocol server for Wireweave DSL - AI-powered wireframe generation</p>
7
+ This server is a thin wrapper over [`@wireweave/sdk`](https://github.com/wireweave/sdk). Every tool call from the MCP client is forwarded to the SDK's single `dispatch()` entry point, which routes it to one of two places:
17
8
 
18
- ## Overview
9
+ - **Local tools** run in-process via `@wireweave/core` and `@wireweave/ux-rules`. No network, no credits — they work even without an API key.
10
+ - **Server tools** are proxied to the Wireweave API server (`api-server`) over HTTP. These require an API key (cloud project/wireframe storage, account & billing, hosted reference content such as the grammar and LLM guide).
19
11
 
20
- This MCP server enables AI assistants like Claude to generate wireframes using the Wireweave DSL. It provides **30 tools** for parsing, rendering, validating, and managing wireframes.
12
+ It serves **32 tools** (9 local + 23 server) plus the prompts and resources defined by the api-server contract. The server does not classify, cache, or post-process results — the SDK and api-server own that logic.
21
13
 
22
- ## Prerequisites
14
+ Local tools:
23
15
 
24
- You need a Wireweave API key. Get one from the [Dashboard](https://wireweave.org).
16
+ `wireweave_parse` · `wireweave_validate` · `wireweave_render_html_code` · `wireweave_validate_ux` · `wireweave_diff` · `wireweave_analyze` · `wireweave_list_components` · `wireweave_export_json` · `wireweave_export_figma`
25
17
 
26
- ## Installation
18
+ ## Install
27
19
 
28
20
  ```bash
29
21
  npm install -g @wireweave/mcp-server
30
22
  ```
31
23
 
32
- Or use directly with npx:
24
+ Or run directly:
33
25
 
34
26
  ```bash
35
27
  npx @wireweave/mcp-server
36
28
  ```
37
29
 
38
- ## Configuration
30
+ Requires Node.js 20+. Get an API key from the [Wireweave dashboard](https://wireweave.org).
39
31
 
40
- ### Claude Desktop
32
+ ## Usage
41
33
 
42
- Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):
34
+ ### MCP client configuration
35
+
36
+ Add the server to your MCP client config. For Claude Desktop (`~/Library/Application Support/Claude/claude_desktop_config.json`):
43
37
 
44
38
  ```json
45
39
  {
@@ -55,114 +49,41 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
55
49
  }
56
50
  ```
57
51
 
58
- ### Environment Variables
59
-
60
- | Variable | Required | Description |
61
- |----------|----------|-------------|
62
- | `WIREWEAVE_API_KEY` | Yes | Your API key from Dashboard |
63
- | `WIREWEAVE_API_URL` | No | API server URL (default: https://api.wireweave.org) |
64
-
65
- ## Available Tools (30)
66
-
67
- ### Core Tools (11)
68
-
69
- | Tool | Description |
70
- |------|-------------|
71
- | `wireweave_parse` | Parse DSL source code into an AST |
72
- | `wireweave_validate` | Validate DSL syntax |
73
- | `wireweave_grammar` | Get DSL grammar documentation |
74
- | `wireweave_guide` | **Primary LLM resource** - comprehensive language guide |
75
- | `wireweave_patterns` | Get common layout patterns |
76
- | `wireweave_examples` | Get code examples by category |
77
- | `wireweave_render_html` | Render DSL to HTML and CSS |
78
- | `wireweave_validate_ux` | Validate UX best practices |
79
- | `wireweave_ux_rules` | Get UX rule categories |
80
- | `wireweave_diff` | Compare two wireframe sources |
81
- | `wireweave_analyze` | Analyze wireframe statistics |
82
-
83
- ### Cloud Storage Tools (15)
84
-
85
- | Tool | Description |
86
- |------|-------------|
87
- | `wireweave_cloud_list_projects` | List your projects |
88
- | `wireweave_cloud_create_project` | Create a new project |
89
- | `wireweave_cloud_update_project` | Update project details |
90
- | `wireweave_cloud_delete_project` | Delete a project |
91
- | `wireweave_cloud_list_wireframes` | List saved wireframes |
92
- | `wireweave_cloud_get_wireframe` | Get a specific wireframe |
93
- | `wireweave_cloud_save_wireframe` | Save a new wireframe |
94
- | `wireweave_cloud_update_wireframe` | Update an existing wireframe |
95
- | `wireweave_cloud_delete_wireframe` | Delete a wireframe |
96
- | `wireweave_cloud_get_versions` | Get version history |
97
- | `wireweave_cloud_restore_version` | Restore to a previous version |
98
- | `wireweave_cloud_diff_versions` | Compare two versions of a wireframe |
99
- | `wireweave_cloud_create_share_link` | Create a shareable link |
100
- | `wireweave_cloud_list_shares` | List share links |
101
- | `wireweave_gallery` | Browse public wireframe gallery |
102
-
103
- ### Account & Billing Tools (4)
104
-
105
- | Tool | Description |
106
- |------|-------------|
107
- | `wireweave_account_balance` | Check credit balance |
108
- | `wireweave_account_subscription` | Get subscription details |
109
- | `wireweave_account_transactions` | View transaction history |
110
- | `wireweave_pricing` | Get pricing information |
111
-
112
- ## Usage Examples
113
-
114
- Once configured, you can ask Claude:
115
-
116
- **Generate a wireframe:**
117
- > "Create a wireframe for a login page with email and password fields"
118
-
119
- **Validate UX:**
120
- > "Check the UX best practices for this wireframe code"
121
-
122
- **Save to cloud:**
123
- > "Save this wireframe as 'Dashboard v2' in my project"
124
-
125
- **Share:**
126
- > "Create a shareable link for this wireframe"
127
-
128
- ## Architecture
52
+ The same `command` / `args` / `env` shape works for any stdio MCP client (Cursor, etc.).
129
53
 
54
+ ### Transport
55
+
56
+ The server runs over **stdio** by default. A streamable-HTTP transport is available with `--http` (or `WIREWEAVE_TRANSPORT=http`), serving the MCP endpoint at `/mcp` and a health check at `/health`.
57
+
58
+ ```bash
59
+ wireweave-mcp # stdio (default)
60
+ wireweave-mcp --http # streamable HTTP on 127.0.0.1:3305
130
61
  ```
131
- ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
132
- │ Claude/LLM │────▶│ MCP Server │────▶│ API Server │
133
- │ │ │ (this package) │ │ │
134
- └─────────────────┘ └─────────────────┘ └─────────────────┘
135
- │ │
136
- Tool definitions Execution
137
- Request forwarding Auth & Rate Limit
138
- Credit management
139
- ```
140
62
 
141
- The MCP server is a thin client that:
142
- - Defines and exposes 30 tools to AI assistants
143
- - Forwards tool calls to the Wireweave API Server
144
- - Returns results back to the AI
63
+ ## Environment
64
+
65
+ | Variable | Default | Purpose |
66
+ | ---------------------------- | --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
67
+ | `WIREWEAVE_API_KEY` | — | API key from the dashboard. Required for server tools; local tools work without it. The server logs a warning at startup if unset. |
68
+ | `WIREWEAVE_API_URL` | `https://api.wireweave.org` | Override the API base. |
69
+ | `WIREWEAVE_TRANSPORT` | `stdio` | Set to `http` for streamable HTTP (same as `--http`). |
70
+ | `WIREWEAVE_MCP_PORT` | `3305` | HTTP transport port. |
71
+ | `WIREWEAVE_MCP_HOST` | `127.0.0.1` | HTTP transport host. |
72
+ | `WIREWEAVE_MCP_MAX_SESSIONS` | `10` | Max concurrent HTTP sessions. |
145
73
 
146
- All authentication, rate limiting, and business logic runs on the API Server.
74
+ ## Tools
147
75
 
148
- ## Credit Costs
76
+ Once connected, ask your MCP client to work with wireframes, for example:
149
77
 
150
- | Feature | Credits |
151
- |---------|---------|
152
- | Parse, Validate | 1 |
153
- | Grammar, Guide, Patterns, Examples, UX Rules | 0 (free) |
154
- | Render HTML | 2 |
155
- | UX Validation | 3 |
156
- | Diff, Analyze | 2 |
157
- | Cloud Save/Update | 1 |
158
- | Create Share Link | 5 |
78
+ > "Parse and validate this Wireweave DSL." (local)
79
+ >
80
+ > "Check this wireframe against UX best practices." (local)
81
+ >
82
+ > "Save this wireframe as 'Dashboard v2' in my project." (server — needs an API key)
159
83
 
160
- ## Links
84
+ Server tools cover cloud project/wireframe CRUD and versioning, share links, the public gallery, account balance & subscription, pricing, and hosted reference content (grammar, guide, patterns, examples, UX rules). Calls that need a key fail with a clear message if one is not configured.
161
85
 
162
- - [Documentation](https://docs.wireweave.org)
163
- - [Dashboard](https://wireweave.org)
164
- - [Playground](https://playground.wireweave.org)
165
- - [GitHub](https://github.com/wireweave/mcp-server)
86
+ Part of the [Wireweave monorepo](https://github.com/wireweave/wireweave).
166
87
 
167
88
  ## License
168
89