tailwindcss-docs-mcp 1.1.0 → 1.3.0
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 +24 -126
- package/dist/auto-index.d.ts +21 -0
- package/dist/auto-index.d.ts.map +1 -0
- package/dist/auto-index.js +27 -0
- package/dist/auto-index.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +8 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +16 -9
- package/dist/server.js.map +1 -1
- package/dist/tools/check-status.d.ts +3 -3
- package/dist/tools/check-status.d.ts.map +1 -1
- package/dist/tools/check-status.js +12 -4
- package/dist/tools/check-status.js.map +1 -1
- package/dist/tools/search-docs.d.ts +2 -1
- package/dist/tools/search-docs.d.ts.map +1 -1
- package/dist/tools/search-docs.js +8 -2
- package/dist/tools/search-docs.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,39 +1,24 @@
|
|
|
1
1
|
# tailwindcss-docs-mcp
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/tailwindcss-docs-mcp)
|
|
4
|
+
[](https://tailwindcss.com/docs)
|
|
5
|
+
[](https://v3.tailwindcss.com/docs)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## LLMs Hallucinate Tailwind Classes. This Fixes That.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Your AI assistant just confidently suggested `bg-opacity-50` — a class that hasn't existed since Tailwind v3. It also recommended `flex-gap-4`, which was never a thing. It's not searching documentation. It's guessing from training data.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
This MCP server downloads the official Tailwind CSS docs, embeds them locally, and gives your assistant real search over real documentation. No API keys, no external services, everything on your machine. Just Node.js 18+.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
{
|
|
15
|
-
"mcpServers": {
|
|
16
|
-
"tailwindcss-docs-mcp": {
|
|
17
|
-
"command": "npx",
|
|
18
|
-
"args": ["-y", "tailwindcss-docs-mcp"]
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
```
|
|
13
|
+
## Getting Started
|
|
23
14
|
|
|
24
|
-
|
|
25
|
-
<summary>Claude Code</summary>
|
|
15
|
+
**Claude Code**
|
|
26
16
|
|
|
27
17
|
```bash
|
|
28
18
|
claude mcp add tailwindcss-docs-mcp -- npx -y tailwindcss-docs-mcp
|
|
29
19
|
```
|
|
30
20
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<details>
|
|
34
|
-
<summary>Cursor / Windsurf</summary>
|
|
35
|
-
|
|
36
|
-
Add to your project's `.mcp.json`:
|
|
21
|
+
**Other MCP clients** (Claude Desktop, Cursor, Windsurf, etc.)
|
|
37
22
|
|
|
38
23
|
```json
|
|
39
24
|
{
|
|
@@ -46,108 +31,17 @@ Add to your project's `.mcp.json`:
|
|
|
46
31
|
}
|
|
47
32
|
```
|
|
48
33
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<details>
|
|
52
|
-
<summary>Smithery</summary>
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
npx -y @smithery/cli@latest install @vitalis/tailwindcss-docs-mcp --client claude
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
</details>
|
|
59
|
-
|
|
60
|
-
### First run
|
|
61
|
-
|
|
62
|
-
On first boot the embedding model (~27 MB) downloads in the background. The server is usable immediately — tools that need embeddings will return a status message until the model is ready.
|
|
63
|
-
|
|
64
|
-
The first time you ask a Tailwind question, your assistant will automatically call `fetch_docs` to download and index the documentation. This happens once — subsequent queries use the local index.
|
|
65
|
-
|
|
66
|
-
### Example prompts
|
|
67
|
-
|
|
68
|
-
- _"How do I center a div with Tailwind?"_
|
|
69
|
-
- _"Show me the grid layout utilities"_
|
|
70
|
-
- _"What's the dark mode configuration in v4?"_
|
|
71
|
-
- _"Search for responsive padding classes"_
|
|
72
|
-
|
|
73
|
-
## Tools
|
|
74
|
-
|
|
75
|
-
### `fetch_docs`
|
|
76
|
-
|
|
77
|
-
Download and index Tailwind CSS documentation. Run once, re-run with `force: true` to refresh.
|
|
78
|
-
|
|
79
|
-
| Parameter | Type | Default | Description |
|
|
80
|
-
| --------- | --------- | ------- | ---------------------------------- |
|
|
81
|
-
| `version` | `string` | `"v4"` | `"v3"` or `"v4"` |
|
|
82
|
-
| `force` | `boolean` | `false` | Re-download even if already cached |
|
|
34
|
+
The embedding model downloads on first boot (~30 seconds), the docs index automatically, and every Tailwind question hits the local index from then on. No setup, no commands to run.
|
|
83
35
|
|
|
84
|
-
|
|
36
|
+
**Using Tailwind v3?** Set `"env": { "TAILWIND_DOCS_MCP_DEFAULT_VERSION": "v3" }` in your config.
|
|
85
37
|
|
|
86
|
-
|
|
38
|
+
**Custom data directory?** Set `TAILWIND_DOCS_MCP_PATH` (default: `~/.tailwindcss-docs-mcp`).
|
|
87
39
|
|
|
88
|
-
|
|
89
|
-
| --------- | -------- | ------- | ----------------------------- |
|
|
90
|
-
| `query` | `string` | — | Natural language search query |
|
|
91
|
-
| `version` | `string` | `"v4"` | `"v3"` or `"v4"` |
|
|
92
|
-
| `limit` | `number` | `5` | Results to return (1–20) |
|
|
40
|
+
## What It Does
|
|
93
41
|
|
|
94
|
-
|
|
42
|
+
Your assistant gets four tools — `search_docs`, `fetch_docs`, `list_utilities`, and `check_status` — and calls them automatically when you ask Tailwind questions.
|
|
95
43
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
| Parameter | Type | Default | Description |
|
|
99
|
-
| ---------- | -------- | ------- | ----------------------- |
|
|
100
|
-
| `category` | `string` | — | Filter by category name |
|
|
101
|
-
| `version` | `string` | `"v4"` | `"v3"` or `"v4"` |
|
|
102
|
-
|
|
103
|
-
### `check_status`
|
|
104
|
-
|
|
105
|
-
Check index state — doc counts, embedding model status, last indexed time.
|
|
106
|
-
|
|
107
|
-
| Parameter | Type | Default | Description |
|
|
108
|
-
| --------- | -------- | ------- | --------------------------------------- |
|
|
109
|
-
| `version` | `string` | — | Check specific version, or omit for all |
|
|
110
|
-
|
|
111
|
-
## How It Works
|
|
112
|
-
|
|
113
|
-
```
|
|
114
|
-
GitHub → Fetch MDX → Parse → Chunk by heading → Embed (ONNX) → SQLite
|
|
115
|
-
↓
|
|
116
|
-
search_docs → Hybrid Search
|
|
117
|
-
Semantic + FTS5
|
|
118
|
-
Rank Fusion
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
- **Hybrid search** — cosine similarity on embeddings + FTS5 keyword match, fused via reciprocal rank fusion. Semantic handles _"how to center a div"_, keywords handle exact classes like `grid-cols-3`.
|
|
122
|
-
- **Incremental re-indexing** — SHA-256 content hashing per chunk. Unchanged content skips re-embedding.
|
|
123
|
-
- **In-process embeddings** — `snowflake-arctic-embed-xs` (22M params, 384 dims) runs locally via ONNX. No external calls.
|
|
124
|
-
- **Auto model management** — the embedding model (~27 MB) downloads on first boot and caches locally. Server starts immediately; model loads in background.
|
|
125
|
-
|
|
126
|
-
## Configuration
|
|
127
|
-
|
|
128
|
-
| Variable | Default | Description |
|
|
129
|
-
| ----------------------------------- | ------------------------- | ------------------------------------- |
|
|
130
|
-
| `TAILWIND_DOCS_MCP_DEFAULT_VERSION` | `v4` | Set to `v3` for Tailwind 3.x projects |
|
|
131
|
-
| `TAILWIND_DOCS_MCP_PATH` | `~/.tailwindcss-docs-mcp` | Data directory |
|
|
132
|
-
|
|
133
|
-
<details>
|
|
134
|
-
<summary>Using with Tailwind CSS v3</summary>
|
|
135
|
-
|
|
136
|
-
```json
|
|
137
|
-
{
|
|
138
|
-
"mcpServers": {
|
|
139
|
-
"tailwindcss-docs-mcp": {
|
|
140
|
-
"command": "npx",
|
|
141
|
-
"args": ["-y", "tailwindcss-docs-mcp"],
|
|
142
|
-
"env": {
|
|
143
|
-
"TAILWIND_DOCS_MCP_DEFAULT_VERSION": "v3"
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
</details>
|
|
44
|
+
Search is hybrid: semantic vectors and full-text keywords run in parallel, merged with reciprocal rank fusion. Class names like `text-lg` or `mx-auto` are automatically expanded to their CSS properties. Both Tailwind v3 and v4 are indexed independently and switchable per query. Everything runs locally via [snowflake-arctic-embed-xs](https://huggingface.co/Snowflake/snowflake-arctic-embed-xs) and SQLite — nothing leaves your machine.
|
|
151
45
|
|
|
152
46
|
## Development
|
|
153
47
|
|
|
@@ -155,15 +49,19 @@ GitHub → Fetch MDX → Parse → Chunk by heading → Embed (ONNX) → SQLite
|
|
|
155
49
|
git clone https://github.com/vitalis/tailwindcss-docs-mcp.git
|
|
156
50
|
cd tailwindcss-docs-mcp
|
|
157
51
|
bun install
|
|
158
|
-
bun run test
|
|
159
|
-
bun run build
|
|
160
|
-
bunx biome check src/
|
|
52
|
+
bun run test # vitest
|
|
53
|
+
bun run build # tsc
|
|
54
|
+
bunx biome check src/ # lint
|
|
161
55
|
```
|
|
162
56
|
|
|
57
|
+
## Getting Help
|
|
58
|
+
|
|
59
|
+
[](https://github.com/vitalis/tailwindcss-docs-mcp/issues)
|
|
60
|
+
|
|
163
61
|
## Acknowledgments
|
|
164
62
|
|
|
165
|
-
|
|
63
|
+
[](https://github.com/bradleygolden/hexdocs-mcp)
|
|
166
64
|
|
|
167
65
|
## License
|
|
168
66
|
|
|
169
|
-
[MIT](LICENSE)
|
|
67
|
+
[](LICENSE)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Embedder } from "./pipeline/embedder.js";
|
|
2
|
+
import type { Database } from "./storage/database.js";
|
|
3
|
+
import type { Config } from "./utils/config.js";
|
|
4
|
+
/**
|
|
5
|
+
* Callbacks for auto-index lifecycle events.
|
|
6
|
+
*/
|
|
7
|
+
export interface AutoIndexCallbacks {
|
|
8
|
+
onStart: () => void;
|
|
9
|
+
onComplete: () => void;
|
|
10
|
+
onError: (error: unknown) => void;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Auto-index the default Tailwind CSS version if not already indexed.
|
|
14
|
+
*
|
|
15
|
+
* Checks the database for an existing index. If found, calls onComplete
|
|
16
|
+
* immediately. Otherwise, triggers handleFetchDocs in the background.
|
|
17
|
+
*
|
|
18
|
+
* Reuses handleFetchDocs which has its own mutex for concurrent-call safety.
|
|
19
|
+
*/
|
|
20
|
+
export declare function maybeAutoIndex(config: Config, db: Database, embedder: Embedder, callbacks: AutoIndexCallbacks): Promise<void>;
|
|
21
|
+
//# sourceMappingURL=auto-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-index.d.ts","sourceRoot":"","sources":["../src/auto-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACnC;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,EAAE,EAAE,QAAQ,EACZ,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,kBAAkB,GAC5B,OAAO,CAAC,IAAI,CAAC,CAkBf"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { handleFetchDocs } from "./tools/fetch-docs.js";
|
|
2
|
+
/**
|
|
3
|
+
* Auto-index the default Tailwind CSS version if not already indexed.
|
|
4
|
+
*
|
|
5
|
+
* Checks the database for an existing index. If found, calls onComplete
|
|
6
|
+
* immediately. Otherwise, triggers handleFetchDocs in the background.
|
|
7
|
+
*
|
|
8
|
+
* Reuses handleFetchDocs which has its own mutex for concurrent-call safety.
|
|
9
|
+
*/
|
|
10
|
+
export async function maybeAutoIndex(config, db, embedder, callbacks) {
|
|
11
|
+
const version = config.defaultVersion;
|
|
12
|
+
// Skip if already indexed
|
|
13
|
+
const status = db.getIndexStatus(version);
|
|
14
|
+
if (status.length > 0) {
|
|
15
|
+
callbacks.onComplete();
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
callbacks.onStart();
|
|
19
|
+
try {
|
|
20
|
+
await handleFetchDocs({ version }, config, db, embedder);
|
|
21
|
+
callbacks.onComplete();
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
callbacks.onError(error);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=auto-index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-index.js","sourceRoot":"","sources":["../src/auto-index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAYxD;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAc,EACd,EAAY,EACZ,QAAkB,EAClB,SAA6B;IAE7B,MAAM,OAAO,GAAG,MAAM,CAAC,cAAc,CAAC;IAEtC,0BAA0B;IAC1B,MAAM,MAAM,GAAG,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAC1C,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtB,SAAS,CAAC,UAAU,EAAE,CAAC;QACvB,OAAO;IACT,CAAC;IAED,SAAS,CAAC,OAAO,EAAE,CAAC;IAEpB,IAAI,CAAC;QACH,MAAM,eAAe,CAAC,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC;QACzD,SAAS,CAAC,UAAU,EAAE,CAAC;IACzB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
* - Success: server is fully operational, check for updates in background
|
|
12
12
|
* - Failure: download model in background, server tools fail until ready
|
|
13
13
|
* 3. Background update/download completes — embedder is hot-swapped immediately
|
|
14
|
+
* 4. Auto-index default version if not already indexed
|
|
14
15
|
*/
|
|
15
16
|
export {};
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;GAaG"}
|
package/dist/index.js
CHANGED
|
@@ -11,8 +11,10 @@
|
|
|
11
11
|
* - Success: server is fully operational, check for updates in background
|
|
12
12
|
* - Failure: download model in background, server tools fail until ready
|
|
13
13
|
* 3. Background update/download completes — embedder is hot-swapped immediately
|
|
14
|
+
* 4. Auto-index default version if not already indexed
|
|
14
15
|
*/
|
|
15
16
|
import { mkdirSync } from "node:fs";
|
|
17
|
+
import { maybeAutoIndex } from "./auto-index.js";
|
|
16
18
|
import { createEmbedder, loadCachedEmbedder } from "./pipeline/embedder.js";
|
|
17
19
|
import { createServer } from "./server.js";
|
|
18
20
|
import { createDatabase } from "./storage/database.js";
|
|
@@ -29,12 +31,30 @@ async function main() {
|
|
|
29
31
|
});
|
|
30
32
|
// Start MCP server immediately (embedder loads in background)
|
|
31
33
|
const server = await createServer({ config, db, embedder: null });
|
|
34
|
+
// Auto-index helper: fire-and-forget after embedder is ready
|
|
35
|
+
function triggerAutoIndex(e) {
|
|
36
|
+
maybeAutoIndex(config, db, e, {
|
|
37
|
+
onStart: () => {
|
|
38
|
+
server.setIndexingStatus("indexing");
|
|
39
|
+
console.error("[tailwindcss-docs-mcp] Auto-indexing documentation...");
|
|
40
|
+
},
|
|
41
|
+
onComplete: () => {
|
|
42
|
+
server.setIndexingStatus("complete");
|
|
43
|
+
console.error("[tailwindcss-docs-mcp] Documentation index ready.");
|
|
44
|
+
},
|
|
45
|
+
onError: (error) => {
|
|
46
|
+
server.setIndexingStatus("failed");
|
|
47
|
+
console.error("[tailwindcss-docs-mcp] Auto-indexing failed:", error);
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
}
|
|
32
51
|
// Phase 1: Try local cache (fast, no network)
|
|
33
52
|
const cached = await loadCachedEmbedder(config);
|
|
34
53
|
if (cached) {
|
|
35
54
|
// Model loaded from cache — server is fully operational
|
|
36
55
|
server.setEmbedder(cached);
|
|
37
56
|
console.error("[tailwindcss-docs-mcp] Embedding model loaded from cache.");
|
|
57
|
+
triggerAutoIndex(cached);
|
|
38
58
|
// Phase 2: Check for model updates in background, hot-swap if updated
|
|
39
59
|
createEmbedder(config)
|
|
40
60
|
.then((updated) => {
|
|
@@ -53,6 +73,7 @@ async function main() {
|
|
|
53
73
|
.then((embedder) => {
|
|
54
74
|
server.setEmbedder(embedder);
|
|
55
75
|
console.error("[tailwindcss-docs-mcp] Embedding model downloaded and ready.");
|
|
76
|
+
triggerAutoIndex(embedder);
|
|
56
77
|
})
|
|
57
78
|
.catch((error) => {
|
|
58
79
|
server.setEmbedderStatus("failed");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AA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H,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -15,6 +15,10 @@ export declare const TOOL_NAMES: {
|
|
|
15
15
|
* Embedder loading status for observability.
|
|
16
16
|
*/
|
|
17
17
|
export type EmbedderStatus = "pending" | "downloading" | "ready" | "failed";
|
|
18
|
+
/**
|
|
19
|
+
* Documentation indexing status for observability.
|
|
20
|
+
*/
|
|
21
|
+
export type IndexingStatus = "idle" | "indexing" | "complete" | "failed";
|
|
18
22
|
/**
|
|
19
23
|
* Server dependencies injected at startup.
|
|
20
24
|
* Embedder may be null if the model is still downloading.
|
|
@@ -34,6 +38,10 @@ export interface ServerHandle {
|
|
|
34
38
|
setEmbedderStatus(status: EmbedderStatus): void;
|
|
35
39
|
/** Get the current embedder loading status. */
|
|
36
40
|
getEmbedderStatus(): EmbedderStatus;
|
|
41
|
+
/** Update the indexing status for observability. */
|
|
42
|
+
setIndexingStatus(status: IndexingStatus): void;
|
|
43
|
+
/** Get the current indexing status. */
|
|
44
|
+
getIndexingStatus(): IndexingStatus;
|
|
37
45
|
}
|
|
38
46
|
export declare const EMBEDDER_STATUS_MESSAGES: Record<EmbedderStatus, string>;
|
|
39
47
|
/**
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAE/E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAKtD,OAAO,KAAK,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MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEzE;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,QAAQ,CAAC;IACb,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,mEAAmE;IACnE,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IACtC,4DAA4D;IAC5D,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAChD,+CAA+C;IAC/C,iBAAiB,IAAI,cAAc,CAAC;IACpC,oDAAoD;IACpD,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAChD,uCAAuC;IACvC,iBAAiB,IAAI,cAAc,CAAC;CACrC;AAED,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAKnE,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,CAgJjG"}
|
package/dist/server.js
CHANGED
|
@@ -33,6 +33,7 @@ export async function createServer(deps, transport) {
|
|
|
33
33
|
const { config, db } = deps;
|
|
34
34
|
let embedder = deps.embedder;
|
|
35
35
|
let embedderStatus = deps.embedder ? "ready" : "pending";
|
|
36
|
+
let indexingStatus = "idle";
|
|
36
37
|
function requireEmbedder() {
|
|
37
38
|
if (!embedder) {
|
|
38
39
|
throw new Error(EMBEDDER_STATUS_MESSAGES[embedderStatus]);
|
|
@@ -51,7 +52,7 @@ export async function createServer(deps, transport) {
|
|
|
51
52
|
version: SERVER_VERSION,
|
|
52
53
|
});
|
|
53
54
|
// Register fetch_docs
|
|
54
|
-
server.tool(TOOL_NAMES.FETCH_DOCS, "Download and index Tailwind CSS documentation
|
|
55
|
+
server.tool(TOOL_NAMES.FETCH_DOCS, "Download and index Tailwind CSS documentation from GitHub. Documentation is indexed automatically on first server start — you do not need to call this unless the user explicitly asks to refresh or re-index, or to index a different version than the default. Use with force: true to re-download after a new Tailwind CSS release.", {
|
|
55
56
|
version: z.enum(["v4", "v3"]).optional().describe("Tailwind CSS major version (default: v4)"),
|
|
56
57
|
force: z
|
|
57
58
|
.boolean()
|
|
@@ -67,12 +68,12 @@ export async function createServer(deps, transport) {
|
|
|
67
68
|
}
|
|
68
69
|
});
|
|
69
70
|
// Register search_docs
|
|
70
|
-
server.tool(TOOL_NAMES.SEARCH_DOCS, "Search Tailwind CSS documentation using natural language.
|
|
71
|
+
server.tool(TOOL_NAMES.SEARCH_DOCS, "Search Tailwind CSS documentation using natural language. Use this when the user asks a specific question about Tailwind utilities, classes, configuration, or concepts (e.g., 'how do I center a div', 'dark mode setup', 'responsive padding'). Returns ranked documentation sections with headings, content, code examples, and links to tailwindcss.com. Do NOT use this for browsing or discovering what utility categories exist — use list_utilities instead. Present the returned markdown documentation directly to the user without reformatting into tables or summaries.", {
|
|
71
72
|
query: z
|
|
72
73
|
.string()
|
|
73
74
|
.describe("Natural language search query (e.g., 'how to add responsive padding', 'dark mode configuration', 'grid layout with gaps')"),
|
|
74
75
|
version: z
|
|
75
|
-
.enum(["
|
|
76
|
+
.enum(["v4", "v3"])
|
|
76
77
|
.optional()
|
|
77
78
|
.describe("Tailwind CSS major version to search (default: v4)"),
|
|
78
79
|
limit: z
|
|
@@ -84,7 +85,7 @@ export async function createServer(deps, transport) {
|
|
|
84
85
|
}, async (params) => {
|
|
85
86
|
try {
|
|
86
87
|
const result = await handleSearchDocs(params, db, requireEmbedder(), config.defaultVersion);
|
|
87
|
-
const text = formatSearchResults(result);
|
|
88
|
+
const text = formatSearchResults(result, indexingStatus);
|
|
88
89
|
return { content: [{ type: "text", text }] };
|
|
89
90
|
}
|
|
90
91
|
catch (error) {
|
|
@@ -92,7 +93,7 @@ export async function createServer(deps, transport) {
|
|
|
92
93
|
}
|
|
93
94
|
});
|
|
94
95
|
// Register list_utilities (does not require embedder)
|
|
95
|
-
server.tool(TOOL_NAMES.LIST_UTILITIES, "List
|
|
96
|
+
server.tool(TOOL_NAMES.LIST_UTILITIES, "List Tailwind CSS utility categories and their documentation pages. Use this when the user wants to browse, discover, or explore what utilities are available (e.g., 'what layout utilities exist', 'show me the effects category', 'list all spacing utilities'). Returns category names with descriptions and links to each utility's documentation page on tailwindcss.com. This is a browsing tool — it shows what categories and pages exist, not detailed usage. Do NOT follow up with search_docs unless the user explicitly asks a specific question. Present the returned list directly to the user.", {
|
|
96
97
|
category: z
|
|
97
98
|
.string()
|
|
98
99
|
.optional()
|
|
@@ -109,14 +110,14 @@ export async function createServer(deps, transport) {
|
|
|
109
110
|
}
|
|
110
111
|
});
|
|
111
112
|
// Register check_status (does not require embedder)
|
|
112
|
-
server.tool(TOOL_NAMES.CHECK_STATUS, "Check the current
|
|
113
|
+
server.tool(TOOL_NAMES.CHECK_STATUS, "Check the current state of the Tailwind CSS documentation index. Returns which versions are indexed, document and chunk counts, embedding model status, and when each version was last indexed. Use this to verify the index is ready or to diagnose why search_docs returns no results.", {
|
|
113
114
|
version: z
|
|
114
|
-
.enum(["
|
|
115
|
+
.enum(["v4", "v3"])
|
|
115
116
|
.optional()
|
|
116
|
-
.describe("Check specific version (
|
|
117
|
+
.describe("Check specific version (v4 or v3). Omit to check all."),
|
|
117
118
|
}, (params) => {
|
|
118
119
|
try {
|
|
119
|
-
const result = handleCheckStatus(params, db, embedderStatus);
|
|
120
|
+
const result = handleCheckStatus(params, db, embedderStatus, indexingStatus);
|
|
120
121
|
return { content: [{ type: "text", text: result.message }] };
|
|
121
122
|
}
|
|
122
123
|
catch (error) {
|
|
@@ -136,6 +137,12 @@ export async function createServer(deps, transport) {
|
|
|
136
137
|
getEmbedderStatus() {
|
|
137
138
|
return embedderStatus;
|
|
138
139
|
},
|
|
140
|
+
setIndexingStatus(status) {
|
|
141
|
+
indexingStatus = status;
|
|
142
|
+
},
|
|
143
|
+
getIndexingStatus() {
|
|
144
|
+
return indexingStatus;
|
|
145
|
+
},
|
|
139
146
|
};
|
|
140
147
|
}
|
|
141
148
|
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG/E,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,KAAK,CAC5C,YAAY,CAAC,IAAI,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAC5C,CAAC;AAEzB;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,aAAa;IAC1B,cAAc,EAAE,gBAAgB;IAChC,YAAY,EAAE,cAAc;CACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC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ACtC,cAAc,GAAG,MAAM,CAAC;QAC1B,CAAC;QACD,iBAAiB;YACf,OAAO,cAAc,CAAC;QACxB,CAAC;QACD,iBAAiB,CAAC,MAAsB;YACtC,cAAc,GAAG,MAAM,CAAC;QAC1B,CAAC;QACD,iBAAiB;YACf,OAAO,cAAc,CAAC;QACxB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EmbedderStatus } from "../server.js";
|
|
1
|
+
import type { EmbedderStatus, IndexingStatus } from "../server.js";
|
|
2
2
|
import type { Database, IndexStatus } from "../storage/database.js";
|
|
3
3
|
import type { TailwindVersion } from "../utils/config.js";
|
|
4
4
|
/**
|
|
@@ -27,9 +27,9 @@ export interface CheckStatusResult {
|
|
|
27
27
|
* Reports the current index state without triggering any work.
|
|
28
28
|
* Returns doc/chunk counts, embedding model used, and last indexed timestamp.
|
|
29
29
|
*/
|
|
30
|
-
export declare function handleCheckStatus(input: CheckStatusInput, db: Database, embedderStatus: EmbedderStatus): CheckStatusResult;
|
|
30
|
+
export declare function handleCheckStatus(input: CheckStatusInput, db: Database, embedderStatus: EmbedderStatus, indexingStatus?: IndexingStatus): CheckStatusResult;
|
|
31
31
|
/**
|
|
32
32
|
* Format the status as markdown for LLM consumption.
|
|
33
33
|
*/
|
|
34
|
-
export declare function formatStatus(indexed: boolean, versions: IndexStatus[], embedderStatus: EmbedderStatus): string;
|
|
34
|
+
export declare function formatStatus(indexed: boolean, versions: IndexStatus[], embedderStatus: EmbedderStatus, indexingStatus?: IndexingStatus): string;
|
|
35
35
|
//# sourceMappingURL=check-status.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-status.d.ts","sourceRoot":"","sources":["../../src/tools/check-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"check-status.d.ts","sourceRoot":"","sources":["../../src/tools/check-status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,iDAAiD;IACjD,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,qCAAqC;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,wCAAwC;IACxC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,sCAAsC;IACtC,cAAc,EAAE,cAAc,CAAC;IAC/B,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,gBAAgB,EACvB,EAAE,EAAE,QAAQ,EACZ,cAAc,EAAE,cAAc,EAC9B,cAAc,CAAC,EAAE,cAAc,GAC9B,iBAAiB,CAOnB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,WAAW,EAAE,EACvB,cAAc,EAAE,cAAc,EAC9B,cAAc,CAAC,EAAE,cAAc,GAC9B,MAAM,CAiCR"}
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
* Reports the current index state without triggering any work.
|
|
5
5
|
* Returns doc/chunk counts, embedding model used, and last indexed timestamp.
|
|
6
6
|
*/
|
|
7
|
-
export function handleCheckStatus(input, db, embedderStatus) {
|
|
7
|
+
export function handleCheckStatus(input, db, embedderStatus, indexingStatus) {
|
|
8
8
|
const versions = db.getIndexStatus(input.version);
|
|
9
9
|
const indexed = versions.length > 0;
|
|
10
|
-
const message = formatStatus(indexed, versions, embedderStatus);
|
|
10
|
+
const message = formatStatus(indexed, versions, embedderStatus, indexingStatus);
|
|
11
11
|
return { indexed, versions, embedderStatus, message };
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Format the status as markdown for LLM consumption.
|
|
15
15
|
*/
|
|
16
|
-
export function formatStatus(indexed, versions, embedderStatus) {
|
|
16
|
+
export function formatStatus(indexed, versions, embedderStatus, indexingStatus) {
|
|
17
17
|
const lines = ["# Tailwind CSS Documentation Index Status\n"];
|
|
18
18
|
// Embedding model status
|
|
19
19
|
const statusLabels = {
|
|
@@ -24,7 +24,15 @@ export function formatStatus(indexed, versions, embedderStatus) {
|
|
|
24
24
|
};
|
|
25
25
|
lines.push(`**Embedding model**: ${statusLabels[embedderStatus]}\n`);
|
|
26
26
|
if (!indexed) {
|
|
27
|
-
|
|
27
|
+
if (indexingStatus === "indexing") {
|
|
28
|
+
lines.push("Auto-indexing in progress. This takes 1-2 minutes on first run.");
|
|
29
|
+
}
|
|
30
|
+
else if (indexingStatus === "failed") {
|
|
31
|
+
lines.push("Auto-indexing failed. Run fetch_docs to index manually.");
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
lines.push("Not indexed. Run fetch_docs to index Tailwind CSS documentation.");
|
|
35
|
+
}
|
|
28
36
|
return lines.join("\n");
|
|
29
37
|
}
|
|
30
38
|
for (const v of versions) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-status.js","sourceRoot":"","sources":["../../src/tools/check-status.ts"],"names":[],"mappings":"AA0BA;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAuB,EACvB,EAAY,EACZ,cAA8B;
|
|
1
|
+
{"version":3,"file":"check-status.js","sourceRoot":"","sources":["../../src/tools/check-status.ts"],"names":[],"mappings":"AA0BA;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAuB,EACvB,EAAY,EACZ,cAA8B,EAC9B,cAA+B;IAE/B,MAAM,QAAQ,GAAG,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,OAAO,CA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AC,iBAAiB,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QAC7C,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,eAAe,KAAK,CAAC,CAAC,oBAAoB,cAAc,CAAC,CAAC;QACvF,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC;QAClD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Embedder } from "../pipeline/embedder.js";
|
|
2
|
+
import type { IndexingStatus } from "../server.js";
|
|
2
3
|
import type { Database } from "../storage/database.js";
|
|
3
4
|
import { type SearchResult } from "../storage/search.js";
|
|
4
5
|
import type { TailwindVersion } from "../utils/config.js";
|
|
@@ -40,5 +41,5 @@ export declare function handleSearchDocs(input: SearchDocsInput, db: Database, e
|
|
|
40
41
|
* - Content snippet
|
|
41
42
|
* - Deep link to tailwindcss.com
|
|
42
43
|
*/
|
|
43
|
-
export declare function formatSearchResults(result: SearchDocsResult): string;
|
|
44
|
+
export declare function formatSearchResults(result: SearchDocsResult, indexingStatus?: IndexingStatus): string;
|
|
44
45
|
//# sourceMappingURL=search-docs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-docs.d.ts","sourceRoot":"","sources":["../../src/tools/search-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,KAAK,YAAY,EAAgB,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,oCAAoC;IACp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AQ,EACZ,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,eAAe,GAC9B,OAAO,CAAC,gBAAgB,CAAC,CAiB3B;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,gBAAgB,EACxB,cAAc,CAAC,EAAE,cAAc,GAC9B,MAAM,CA0BR"}
|
|
@@ -33,9 +33,15 @@ export async function handleSearchDocs(input, db, embedder, defaultVersion) {
|
|
|
33
33
|
* - Content snippet
|
|
34
34
|
* - Deep link to tailwindcss.com
|
|
35
35
|
*/
|
|
36
|
-
export function formatSearchResults(result) {
|
|
36
|
+
export function formatSearchResults(result, indexingStatus) {
|
|
37
37
|
if (result.notIndexed) {
|
|
38
|
-
|
|
38
|
+
if (indexingStatus === "indexing") {
|
|
39
|
+
return "Documentation is being indexed automatically. This takes 1-2 minutes on first run. Please wait a moment and try again.";
|
|
40
|
+
}
|
|
41
|
+
if (indexingStatus === "failed") {
|
|
42
|
+
return "Auto-indexing failed. Run fetch_docs to index manually.";
|
|
43
|
+
}
|
|
44
|
+
return "Index not built for this version. Run fetch_docs to index.";
|
|
39
45
|
}
|
|
40
46
|
if (result.results.length === 0) {
|
|
41
47
|
return "No results found for this query.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-docs.js","sourceRoot":"","sources":["../../src/tools/search-docs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"search-docs.js","sourceRoot":"","sources":["../../src/tools/search-docs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAqB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAuBvE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,KAAsB,EACtB,EAAY,EACZ,QAAkB,EAClB,cAA+B;IAE/B,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,cAAc,CAAC;IAChD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAA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