@syntholoc/mcp 0.1.0 → 0.1.2

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 CHANGED
@@ -1,44 +1,73 @@
1
1
  # @syntholoc/mcp
2
2
 
3
- MCP-сервер Syntholoc — позволяет пользоваться платформой локализации прямо из Claude Code.
4
- Часть плана [`docs/CLAUDE_CODE_INTEGRATION_PLAN.md`](../../docs/CLAUDE_CODE_INTEGRATION_PLAN.md) (Фаза 1, stdio + API-ключ).
3
+ The [Syntholoc](https://syntholoc.com) MCP server — manage AI localization and
4
+ translation straight from [Claude Code](https://claude.com/claude-code) (or any
5
+ MCP client), without leaving your editor.
5
6
 
6
- ## Запуск
7
+ ## Add to Claude Code
7
8
 
8
9
  ```bash
9
- SYNTHOLOC_API_URL=http://localhost:4000/graphql \
10
- SYNTHOLOC_API_KEY=<ваш ключ> \
11
- bun run apps/mcp/src/index.ts
10
+ claude mcp add --transport stdio syntholoc \
11
+ --env SYNTHOLOC_API_KEY=<your-api-key> \
12
+ -- bunx @syntholoc/mcp
12
13
  ```
13
14
 
14
- `SYNTHOLOC_API_KEY` отправляется заголовком `x-api-key`; организация выводится из метаданных
15
- ключа на сервере. `get_config` работает и без ключа (публичный `appInfo`).
15
+ Get an API key from your Syntholoc dashboard. It is sent as the `x-api-key`
16
+ header; the active organization is resolved from the key server-side and is
17
+ never passed as a tool argument.
16
18
 
17
- ## Подключение к Claude Code
19
+ ### Environment variables
18
20
 
19
- ```bash
20
- claude mcp add --transport stdio syntholoc \
21
- --env SYNTHOLOC_API_KEY=<ваш ключ> \
22
- --env SYNTHOLOC_API_URL=http://localhost:4000/graphql \
23
- -- bun run /абсолютный/путь/apps/mcp/src/index.ts
21
+ | Variable | Default | Description |
22
+ |---|---|---|
23
+ | `SYNTHOLOC_API_KEY` | – | Machine API key (`x-api-key`). Required for most tools. |
24
+ | `SYNTHOLOC_API_URL` | `https://api.syntholoc.com/graphql` | GraphQL endpoint. Override to target a self-hosted or local instance. |
25
+ | `SYNTHOLOC_TOOL_SETS` | *(all)* | Comma-separated tool sets to load (`projects,keys,translations,qa,glossary,styleguides,tm,git,providers,jobs,analytics,locales,config`). Fewer tools = a more focused agent. |
26
+ | `SYNTHOLOC_READ_ONLY` | `false` | Set `true` to expose only read-only tools (list/get) — safe exploration and onboarding. |
27
+ | `SYNTHOLOC_TOOL_FILTER` | *(none)* | Comma-separated wildcard patterns matched against tool names (e.g. `list_*,get_*`). |
28
+
29
+ > The remote (HTTP) transport accepts the same controls as request headers:
30
+ > `syntholoc-tool-sets`, `syntholoc-read-only`, `syntholoc-tool-filter`. The hosted
31
+ > endpoint is versioned at `/mcp/v1` (the legacy `/mcp` path still works).
32
+
33
+ ### Choosing an organization (hosted / OAuth)
34
+
35
+ An OAuth token is per-user and may belong to several organizations. By default the
36
+ earliest one is used. To pin a specific org, send the `syntholoc-org-id` header
37
+ (verified against your membership). List the ids with the `list_organizations` tool
38
+ or the `syntholoc://organizations` resource, then add it to your client config, e.g.:
39
+
40
+ ```json
41
+ {
42
+ "mcpServers": {
43
+ "syntholoc": {
44
+ "type": "http",
45
+ "url": "https://api.syntholoc.com/mcp/v1",
46
+ "headers": { "syntholoc-org-id": "<org-id>" }
47
+ }
48
+ }
49
+ }
24
50
  ```
25
51
 
26
- ## Инструменты
52
+ API-key (stdio) clients don't need this — the key is already scoped to one org.
53
+
54
+ ## What you can do
55
+
56
+ Task-oriented tools across the whole platform: projects, locales, source keys,
57
+ translation, QA, glossary, style guides, git integration, LLM providers, jobs,
58
+ and analytics — plus MCP resources and prompts for common workflows.
27
59
 
28
- 45 task-ориентированных инструментов по доменам: проекты, локали, ключи (`upsert_keys` для
29
- delta-синка), перевод (`translate_locale`/`translate_key` → `jobIds`), QA, глоссарий, style guides,
30
- git, провайдеры, джобы (`get_job`/`wait_for_job` — поллинг), аналитика. Плюс **ресурсы**
31
- (`syntholoc://config|projects|project/{id}`) и **промпты** (`localize_changed`, `review_locale`,
32
- `bootstrap_project`).
60
+ Typical asks, one sentence each:
33
61
 
34
- ### Порог батч-перевода (cost-оптимизация)
62
+ - *"Translate the untranslated German strings and wait for it to finish."*
63
+ - *"Show project progress and the QA score."*
64
+ - *"Add these glossary terms and re-run QA on French."*
65
+ - *"Export the Spanish locale."*
35
66
 
36
- `translate_locale` всегда переводит при вызове. Политику «копить до `maxBulkSize` или спросить»
37
- применяет клиент (навык/хук) для **проактивных** синков, а не сам инструмент — прямая просьба
38
- пользователя выполняется независимо от количества новых ключей. См. §8 плана.
67
+ Translation runs asynchronously and returns a job id; a `wait_for_job` tool
68
+ blocks until completion, so you can chain "translate → wait → export" in a
69
+ single request.
39
70
 
40
- ## Типы
71
+ ## License
41
72
 
42
- Типобезопасный GraphQL-клиент и операции — в общем пакете
43
- [`@syntholoc/sdk`](../../packages/sdk) (codegen из `apps/api/src/schema.gql`), который
44
- переиспользуют и MCP-сервер, и CLI. Инструменты импортируют операции и `GraphQLClient` из SDK.
73
+ MIT
@@ -1,11 +1,33 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import { GraphQLClient } from '@syntholoc/sdk';
3
3
 
4
+ /**
5
+ * Server-side tool-filtering options, mirroring Crowdin's `crowdin-tool-sets` /
6
+ * `crowdin-read-only` / `crowdin-tool-filter` headers. Applied before the tool
7
+ * list is returned so the agent only sees a focused surface.
8
+ */
9
+ interface ToolFilterOptions {
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
+ }
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
+
20
+ /** The valid tool-set names clients may request. */
21
+ declare const TOOL_SET_NAMES: string[];
22
+
4
23
  /**
5
24
  * Builds a fully-configured Syntholoc MCP server (tools + resources + prompts)
6
25
  * bound to the given GraphQL client. Shared by the stdio entrypoint and the
7
26
  * NestJS remote `/mcp` (Streamable HTTP) endpoint.
27
+ *
28
+ * `opts` optionally narrows the exposed tool surface (tool sets, read-only mode,
29
+ * name-pattern filter) so the agent sees only what a given client needs.
8
30
  */
9
- declare function buildMcpServer(gql: GraphQLClient): McpServer;
31
+ declare function buildMcpServer(gql: GraphQLClient, opts?: ToolFilterOptions): McpServer;
10
32
 
11
- export { buildMcpServer };
33
+ export { TOOL_SET_NAMES, type ToolFilterOptions, buildMcpServer, parseList };
@@ -1,7 +1,10 @@
1
1
  import {
2
- buildMcpServer
3
- } from "./chunk-N4PXYXAP.js";
2
+ TOOL_SET_NAMES,
3
+ buildMcpServer,
4
+ parseList
5
+ } from "./chunk-QOVGANRN.js";
4
6
  export {
5
- buildMcpServer
7
+ TOOL_SET_NAMES,
8
+ buildMcpServer,
9
+ parseList
6
10
  };
7
- //# sourceMappingURL=build-server.js.map