@syntholoc/mcp 0.5.0 → 0.6.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 +5 -0
- package/dist/build-server-3r0JYcI7.js +2098 -0
- package/dist/build-server.d.ts +18 -16
- package/dist/build-server.js +2 -10
- package/dist/index.d.ts +1 -1
- package/dist/index.js +25 -26
- package/package.json +6 -5
- package/dist/chunk-V5AAF2RJ.js +0 -1513
package/dist/build-server.d.ts
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { GraphQLClient } from "@syntholoc/sdk";
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
//#region src/filter.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Server-side tool-filtering options, mirroring Crowdin's `crowdin-tool-sets` /
|
|
6
6
|
* `crowdin-read-only` / `crowdin-tool-filter` headers. Applied before the tool
|
|
7
7
|
* list is returned so the agent only sees a focused surface.
|
|
8
8
|
*/
|
|
9
9
|
interface ToolFilterOptions {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
/** Tool-set names to load (see TOOL_SET_NAMES). Empty / undefined / ['all'] loads everything. */
|
|
11
|
+
toolSets?: string[];
|
|
12
|
+
/** When true, only read-only tools (annotations.readOnlyHint) are exposed. */
|
|
13
|
+
readOnly?: boolean;
|
|
14
|
+
/** Wildcard patterns matched against tool names (e.g. "list_*", "project*"). */
|
|
15
|
+
toolFilter?: string[];
|
|
16
16
|
}
|
|
17
17
|
/** Parses a comma-separated header/env value into a trimmed, non-empty string list. */
|
|
18
|
-
declare function parseList(value: string | undefined | null): string[] | undefined;
|
|
19
|
-
|
|
18
|
+
export declare function parseList(value: string | undefined | null): string[] | undefined;
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/tools/index.d.ts
|
|
20
21
|
/** The valid tool-set names clients may request. */
|
|
21
|
-
declare const TOOL_SET_NAMES: string[];
|
|
22
|
-
|
|
22
|
+
export declare const TOOL_SET_NAMES: string[];
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/build-server.d.ts
|
|
23
25
|
/**
|
|
24
26
|
* Builds a fully-configured Syntholoc MCP server (tools + resources + prompts)
|
|
25
27
|
* bound to the given GraphQL client. Shared by the stdio entrypoint and the
|
|
@@ -28,6 +30,6 @@ declare const TOOL_SET_NAMES: string[];
|
|
|
28
30
|
* `opts` optionally narrows the exposed tool surface (tool sets, read-only mode,
|
|
29
31
|
* name-pattern filter) so the agent sees only what a given client needs.
|
|
30
32
|
*/
|
|
31
|
-
declare function buildMcpServer(gql: GraphQLClient, opts?: ToolFilterOptions): McpServer;
|
|
32
|
-
|
|
33
|
-
export {
|
|
33
|
+
export declare function buildMcpServer(gql: GraphQLClient, opts?: ToolFilterOptions): McpServer;
|
|
34
|
+
//#endregion
|
|
35
|
+
export type { ToolFilterOptions };
|
package/dist/build-server.js
CHANGED
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
buildMcpServer,
|
|
4
|
-
parseList
|
|
5
|
-
} from "./chunk-V5AAF2RJ.js";
|
|
6
|
-
export {
|
|
7
|
-
TOOL_SET_NAMES,
|
|
8
|
-
buildMcpServer,
|
|
9
|
-
parseList
|
|
10
|
-
};
|
|
1
|
+
import { n as TOOL_SET_NAMES, r as parseList, t as buildMcpServer } from "./build-server-3r0JYcI7.js";
|
|
2
|
+
export { TOOL_SET_NAMES, buildMcpServer, parseList };
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {}
|
package/dist/index.js
CHANGED
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
buildMcpServer,
|
|
4
|
-
parseList
|
|
5
|
-
} from "./chunk-V5AAF2RJ.js";
|
|
6
|
-
|
|
7
|
-
// src/index.ts
|
|
2
|
+
import { r as parseList, t as buildMcpServer } from "./build-server-3r0JYcI7.js";
|
|
8
3
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
9
4
|
import { GraphQLClient } from "@syntholoc/sdk";
|
|
10
|
-
|
|
11
|
-
// src/config.ts
|
|
5
|
+
//#region src/config.ts
|
|
12
6
|
function loadConfig(env = process.env) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
return {
|
|
8
|
+
apiUrl: env.SYNTHOLOC_API_URL ?? "https://api.syntholoc.com/graphql",
|
|
9
|
+
apiKey: env.SYNTHOLOC_API_KEY
|
|
10
|
+
};
|
|
17
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Reads tool-filtering options from the environment so a stdio client can focus
|
|
14
|
+
* the exposed tool surface (mirrors the HTTP transport's `syntholoc-*` headers).
|
|
15
|
+
*/
|
|
18
16
|
function loadToolOptions(env = process.env) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
return {
|
|
18
|
+
toolSets: parseList(env.SYNTHOLOC_TOOL_SETS),
|
|
19
|
+
readOnly: env.SYNTHOLOC_READ_ONLY === "true",
|
|
20
|
+
toolFilter: parseList(env.SYNTHOLOC_TOOL_FILTER)
|
|
21
|
+
};
|
|
24
22
|
}
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/index.ts
|
|
27
25
|
async function main() {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
console.error(`[syntholoc-mcp] ready (api: ${config.apiUrl}${config.apiKey ? "" : ", no API key set"})`);
|
|
26
|
+
const config = loadConfig();
|
|
27
|
+
const gql = new GraphQLClient(config);
|
|
28
|
+
await buildMcpServer(gql, loadToolOptions()).connect(new StdioServerTransport());
|
|
29
|
+
console.error(`[syntholoc-mcp] ready (api: ${config.apiUrl}${config.apiKey ? "" : ", no API key set"})`);
|
|
33
30
|
}
|
|
34
31
|
main().catch((err) => {
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
console.error("[syntholoc-mcp] fatal:", err);
|
|
33
|
+
process.exit(1);
|
|
37
34
|
});
|
|
35
|
+
//#endregion
|
|
36
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syntholoc/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Syntholoc MCP server — manage AI localization and translation from Codex, Claude Code, and other MCP clients.",
|
|
5
5
|
"homepage": "https://syntholoc.com",
|
|
6
6
|
"keywords": [
|
|
@@ -47,18 +47,19 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@modelcontextprotocol/sdk": "1.22.0",
|
|
50
|
-
"@syntholoc/sdk": "0.
|
|
50
|
+
"@syntholoc/sdk": "0.5.0",
|
|
51
51
|
"zod": "3.25.76"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@graphql-codegen/cli": "7.1.2",
|
|
55
55
|
"@graphql-codegen/typescript": "5.0.2",
|
|
56
56
|
"@syntholoc/shared": "0.1.0",
|
|
57
|
-
"@types/bun": "1.
|
|
57
|
+
"@types/bun": "1.4.2",
|
|
58
58
|
"@types/node": "22.19.21",
|
|
59
59
|
"graphql": "16.14.2",
|
|
60
60
|
"graphql-codegen-typescript-validation-schema": "0.19.0",
|
|
61
|
-
"
|
|
62
|
-
"typescript": "
|
|
61
|
+
"tsdown": "0.23.0",
|
|
62
|
+
"typescript": "7.0.2",
|
|
63
|
+
"vitest": "4.1.11"
|
|
63
64
|
}
|
|
64
65
|
}
|