@thallylabs/mcp 0.8.0 → 0.9.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 +12 -5
- package/dist/create-project.d.ts +49 -0
- package/dist/create-project.js +67 -0
- package/dist/index.js +129 -336
- package/dist/tools.js +129 -336
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# @thallylabs/mcp
|
|
2
2
|
|
|
3
3
|
A [Model Context Protocol](https://modelcontextprotocol.io) server that lets AI
|
|
4
|
-
tools — Claude Code, Claude Desktop, Cursor, Windsurf —
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
tools — Claude Code, Claude Desktop, Cursor, Windsurf — manage
|
|
5
|
+
[Thally](https://github.com/thallylabs/thally) knowledge surfaces through
|
|
6
|
+
natural language. Tools can create, read, update, search, and migrate
|
|
7
|
+
documentation, then trace a product-repository change into reviewable docs
|
|
8
|
+
work.
|
|
7
9
|
|
|
8
10
|
## Setup
|
|
9
11
|
|
|
@@ -28,17 +30,22 @@ Or in a `mcp.json` / client config:
|
|
|
28
30
|
|
|
29
31
|
## Tools
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
15 tools, including:
|
|
32
34
|
|
|
33
35
|
- **Authoring** — `create_project`, `add_page`, `update_page`, `read_page`, `list_pages`, `add_tab`
|
|
34
36
|
- **Context & search** — `get_context`, `search_docs`, `semantic_search` (against a deployed site)
|
|
35
37
|
- **Quality** — `lint_project`, `agent_readiness` (the Agent Readiness Score of a deployed site)
|
|
36
|
-
- **Migration** — `migrate_docs`, `translate_docs`
|
|
38
|
+
- **Migration** — `migrate_docs`, `import_docs`, `translate_docs`
|
|
39
|
+
- **Product changes** — `sync_from_repo`
|
|
37
40
|
|
|
38
41
|
`search_docs`, `read_page`, and `get_context` work against a local project on
|
|
39
42
|
disk; `semantic_search` and `agent_readiness` run against any **deployed** Thally
|
|
40
43
|
site over HTTP.
|
|
41
44
|
|
|
45
|
+
`migrate_docs` always scaffolds a fresh canonical Thally template before it
|
|
46
|
+
imports content. To preserve an existing Thally runtime and import content in
|
|
47
|
+
place, the caller must explicitly choose `import_docs`.
|
|
48
|
+
|
|
42
49
|
## License
|
|
43
50
|
|
|
44
51
|
MIT
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const createProjectSchema: z.ZodObject<{
|
|
4
|
+
projectDir: z.ZodString;
|
|
5
|
+
projectName: z.ZodOptional<z.ZodString>;
|
|
6
|
+
description: z.ZodOptional<z.ZodString>;
|
|
7
|
+
brandPreset: z.ZodDefault<z.ZodOptional<z.ZodEnum<["primary", "secondary"]>>>;
|
|
8
|
+
repoUrl: z.ZodOptional<z.ZodString>;
|
|
9
|
+
install: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
10
|
+
enableAiChat: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
11
|
+
i18nLocales: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
12
|
+
code: z.ZodString;
|
|
13
|
+
label: z.ZodString;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
code: string;
|
|
16
|
+
label: string;
|
|
17
|
+
}, {
|
|
18
|
+
code: string;
|
|
19
|
+
label: string;
|
|
20
|
+
}>, "many">>;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
projectDir: string;
|
|
23
|
+
brandPreset: "primary" | "secondary";
|
|
24
|
+
install: boolean;
|
|
25
|
+
enableAiChat: boolean;
|
|
26
|
+
projectName?: string | undefined;
|
|
27
|
+
description?: string | undefined;
|
|
28
|
+
repoUrl?: string | undefined;
|
|
29
|
+
i18nLocales?: {
|
|
30
|
+
code: string;
|
|
31
|
+
label: string;
|
|
32
|
+
}[] | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
projectDir: string;
|
|
35
|
+
projectName?: string | undefined;
|
|
36
|
+
description?: string | undefined;
|
|
37
|
+
brandPreset?: "primary" | "secondary" | undefined;
|
|
38
|
+
repoUrl?: string | undefined;
|
|
39
|
+
install?: boolean | undefined;
|
|
40
|
+
enableAiChat?: boolean | undefined;
|
|
41
|
+
i18nLocales?: {
|
|
42
|
+
code: string;
|
|
43
|
+
label: string;
|
|
44
|
+
}[] | undefined;
|
|
45
|
+
}>;
|
|
46
|
+
type CreateProjectInput = z.infer<typeof createProjectSchema>;
|
|
47
|
+
declare function handleCreateProject(input: CreateProjectInput): Promise<string>;
|
|
48
|
+
|
|
49
|
+
export { type CreateProjectInput, createProjectSchema, handleCreateProject };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// src/tools/create-project.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
// src/lib/scaffold.ts
|
|
5
|
+
import {
|
|
6
|
+
EXCLUDE_PATHS,
|
|
7
|
+
STABLE_SCAFFOLD_RELEASE,
|
|
8
|
+
TEMPLATE_REPOSITORY,
|
|
9
|
+
scaffold as scaffoldProject,
|
|
10
|
+
shouldInclude
|
|
11
|
+
} from "create-thally-docs/scaffold";
|
|
12
|
+
import { buildStarterDocsJson } from "create-thally-docs/starter";
|
|
13
|
+
var MCP_TEMPLATE_COMMIT_SHA = STABLE_SCAFFOLD_RELEASE.source.commitSha;
|
|
14
|
+
var MCP_SCAFFOLD_RELEASE_ID = STABLE_SCAFFOLD_RELEASE.id;
|
|
15
|
+
async function scaffold(options) {
|
|
16
|
+
return scaffoldProject(options);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// src/tools/create-project.ts
|
|
20
|
+
var createProjectSchema = z.object({
|
|
21
|
+
projectDir: z.string().describe("Path where the new Thally project should be created"),
|
|
22
|
+
projectName: z.string().optional().describe("Display name of the project (defaults to directory name)"),
|
|
23
|
+
description: z.string().optional().describe("Short description of the project"),
|
|
24
|
+
brandPreset: z.enum(["primary", "secondary"]).optional().default("primary").describe("Brand color preset"),
|
|
25
|
+
repoUrl: z.string().optional().describe("GitHub repository URL (optional)"),
|
|
26
|
+
install: z.boolean().optional().default(true).describe("Whether to run npm install after scaffolding"),
|
|
27
|
+
enableAiChat: z.boolean().optional().default(true).describe("Enable AI chat in docs.json (default true)"),
|
|
28
|
+
i18nLocales: z.array(z.object({ code: z.string(), label: z.string() })).optional().describe('Additional locales beyond the included English and Spanish defaults (e.g. [{code:"fr",label:"Fran\xE7ais"}])')
|
|
29
|
+
});
|
|
30
|
+
async function handleCreateProject(input) {
|
|
31
|
+
const { projectDir, brandPreset = "primary", install = true } = input;
|
|
32
|
+
const dirBase = projectDir.split("/").filter(Boolean).pop() ?? "my-docs";
|
|
33
|
+
const projectName = input.projectName ?? dirBase.replace(/[-_]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
34
|
+
const description = input.description ?? `Documentation for ${projectName}.`;
|
|
35
|
+
const repoUrl = input.repoUrl ?? "";
|
|
36
|
+
const result = await scaffold({
|
|
37
|
+
projectDir,
|
|
38
|
+
projectName,
|
|
39
|
+
description,
|
|
40
|
+
brandPreset,
|
|
41
|
+
repoUrl,
|
|
42
|
+
doInstall: install,
|
|
43
|
+
enableAiChat: input.enableAiChat ?? true,
|
|
44
|
+
i18nLocales: input.i18nLocales
|
|
45
|
+
});
|
|
46
|
+
const dirName = result.projectDir.split("/").pop() ?? projectDir;
|
|
47
|
+
return [
|
|
48
|
+
`\u2705 Thally project "${projectName}" created at: ${result.projectDir}`,
|
|
49
|
+
"",
|
|
50
|
+
"Next steps:",
|
|
51
|
+
` cd ${dirName}`,
|
|
52
|
+
" npm run dev",
|
|
53
|
+
"",
|
|
54
|
+
"Then open http://localhost:3040 to see your docs.",
|
|
55
|
+
"",
|
|
56
|
+
"Key files to edit:",
|
|
57
|
+
" \u2022 src/data/site.ts \u2014 name, links, branding",
|
|
58
|
+
" \u2022 docs.json \u2014 navigation, AI chat config",
|
|
59
|
+
" \u2022 src/content/*.mdx \u2014 your documentation",
|
|
60
|
+
"",
|
|
61
|
+
...input.enableAiChat !== false ? ["\u{1F916} AI chat is enabled. Set ANTHROPIC_API_KEY in .env.local."] : []
|
|
62
|
+
].join("\n");
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
createProjectSchema,
|
|
66
|
+
handleCreateProject
|
|
67
|
+
};
|