@syntholoc/mcp 0.1.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/LICENSE +21 -0
- package/README.md +44 -0
- package/dist/build-server.d.ts +11 -0
- package/dist/build-server.js +7 -0
- package/dist/build-server.js.map +1 -0
- package/dist/chunk-N4PXYXAP.js +850 -0
- package/dist/chunk-N4PXYXAP.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/package.json +59 -0
- package/src/build-server.ts +18 -0
- package/src/config.ts +8 -0
- package/src/index.ts +20 -0
- package/src/prompts.ts +73 -0
- package/src/resources.ts +43 -0
- package/src/tools/analytics.ts +55 -0
- package/src/tools/config.ts +19 -0
- package/src/tools/git.ts +68 -0
- package/src/tools/glossary.ts +84 -0
- package/src/tools/index.ts +30 -0
- package/src/tools/jobs.ts +53 -0
- package/src/tools/keys.ts +114 -0
- package/src/tools/locales.ts +60 -0
- package/src/tools/projects.ts +74 -0
- package/src/tools/providers.ts +35 -0
- package/src/tools/qa.ts +46 -0
- package/src/tools/styleguides.ts +49 -0
- package/src/tools/translations.ts +156 -0
- package/src/util.ts +9 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Syntholoc
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# @syntholoc/mcp
|
|
2
|
+
|
|
3
|
+
MCP-сервер Syntholoc — позволяет пользоваться платформой локализации прямо из Claude Code.
|
|
4
|
+
Часть плана [`docs/CLAUDE_CODE_INTEGRATION_PLAN.md`](../../docs/CLAUDE_CODE_INTEGRATION_PLAN.md) (Фаза 1, stdio + API-ключ).
|
|
5
|
+
|
|
6
|
+
## Запуск
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
SYNTHOLOC_API_URL=http://localhost:4000/graphql \
|
|
10
|
+
SYNTHOLOC_API_KEY=<ваш ключ> \
|
|
11
|
+
bun run apps/mcp/src/index.ts
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`SYNTHOLOC_API_KEY` отправляется заголовком `x-api-key`; организация выводится из метаданных
|
|
15
|
+
ключа на сервере. `get_config` работает и без ключа (публичный `appInfo`).
|
|
16
|
+
|
|
17
|
+
## Подключение к Claude Code
|
|
18
|
+
|
|
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
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Инструменты
|
|
27
|
+
|
|
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`).
|
|
33
|
+
|
|
34
|
+
### Порог батч-перевода (cost-оптимизация)
|
|
35
|
+
|
|
36
|
+
`translate_locale` всегда переводит при вызове. Политику «копить до `maxBulkSize` или спросить»
|
|
37
|
+
применяет клиент (навык/хук) для **проактивных** синков, а не сам инструмент — прямая просьба
|
|
38
|
+
пользователя выполняется независимо от количества новых ключей. См. §8 плана.
|
|
39
|
+
|
|
40
|
+
## Типы
|
|
41
|
+
|
|
42
|
+
Типобезопасный GraphQL-клиент и операции — в общем пакете
|
|
43
|
+
[`@syntholoc/sdk`](../../packages/sdk) (codegen из `apps/api/src/schema.gql`), который
|
|
44
|
+
переиспользуют и MCP-сервер, и CLI. Инструменты импортируют операции и `GraphQLClient` из SDK.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { GraphQLClient } from '@syntholoc/sdk';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Builds a fully-configured Syntholoc MCP server (tools + resources + prompts)
|
|
6
|
+
* bound to the given GraphQL client. Shared by the stdio entrypoint and the
|
|
7
|
+
* NestJS remote `/mcp` (Streamable HTTP) endpoint.
|
|
8
|
+
*/
|
|
9
|
+
declare function buildMcpServer(gql: GraphQLClient): McpServer;
|
|
10
|
+
|
|
11
|
+
export { buildMcpServer };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|