umtri-mcp 1.0.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/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "umtri-mcp",
3
+ "version": "1.0.0",
4
+ "description": "MCP server for Umtri — give your AI coding agent a persistent map of your project's structure, dependencies, and bugs.",
5
+ "keywords": [
6
+ "mcp",
7
+ "model-context-protocol",
8
+ "umtri",
9
+ "ai",
10
+ "agent",
11
+ "codebase",
12
+ "architecture",
13
+ "dependency-graph",
14
+ "blast-radius",
15
+ "claude"
16
+ ],
17
+ "homepage": "https://umtri.io",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/bepuljang/umtri-mcp.git"
21
+ },
22
+ "bugs": {
23
+ "url": "https://github.com/bepuljang/umtri-mcp/issues"
24
+ },
25
+ "license": "Apache-2.0",
26
+ "author": "Umtri <support@umtri.io>",
27
+ "type": "module",
28
+ "main": "server.js",
29
+ "bin": {
30
+ "umtri-mcp": "./server.js"
31
+ },
32
+ "files": [
33
+ "server.js",
34
+ "core/",
35
+ "README.md",
36
+ "LICENSE"
37
+ ],
38
+ "engines": {
39
+ "node": ">=20"
40
+ },
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "scripts": {
45
+ "start": "node server.js"
46
+ },
47
+ "dependencies": {
48
+ "@modelcontextprotocol/sdk": "^1.29.0",
49
+ "zod": "^3.23.0"
50
+ }
51
+ }
package/server.js ADDED
@@ -0,0 +1,54 @@
1
+ #!/usr/bin/env node
2
+ // Umtri MCP — stdio transport entry. 도구/리소스/정책은 ./core/ 에서 import.
3
+ //
4
+ // 이 디렉토리(server/mcp/)는 npm 패키지 `umtri-mcp`의 루트이자 공개 미러 리포의
5
+ // 원본이다. 배포되지 않을 파일은 여기 두지 않는다 — sync·publish가 "통째로 복사"로
6
+ // 단순해지는 대신, 내부 문서를 여기 두면 그대로 공개된다.
7
+ //
8
+ // Env
9
+ // UMTRI_API_TOKEN — required. `umtri_pat_…` from app.umtri.io → Settings → API Tokens.
10
+ // UMTRI_API_BASE — optional, defaults to https://api.umtri.io.
11
+ //
12
+ // stdout is reserved for the JSON-RPC protocol — never log to console.log; use console.error.
13
+
14
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
15
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
16
+ import { fileURLToPath } from 'node:url';
17
+ import { createRequire } from 'node:module';
18
+ import { dirname, join } from 'node:path';
19
+ import { createApiClient } from './core/api-client.js';
20
+ import { registerTools } from './core/tools.js';
21
+ import { registerResources } from './core/resources.js';
22
+
23
+ const __dirname = dirname(fileURLToPath(import.meta.url));
24
+ const RESOURCES_DIR = join(__dirname, 'core', 'resources');
25
+
26
+ // 버전은 package.json 단일 출처. 여기 상수로 박아두면 publish한 버전과
27
+ // 클라이언트가 보고하는 버전이 조용히 어긋난다.
28
+ // (import attributes 대신 createRequire — Node 20~22에서 문법이 갈리지 않는다.)
29
+ const { version: VERSION } = createRequire(import.meta.url)('./package.json');
30
+
31
+ const API_BASE = process.env.UMTRI_API_BASE || 'https://api.umtri.io';
32
+ const API_TOKEN = process.env.UMTRI_API_TOKEN;
33
+
34
+ if (!API_TOKEN) {
35
+ console.error('[umtri-mcp] UMTRI_API_TOKEN is required. Generate one at app.umtri.io → Settings → API Tokens.');
36
+ process.exit(1);
37
+ }
38
+
39
+ const api = createApiClient({
40
+ baseUrl: API_BASE,
41
+ getToken: () => API_TOKEN,
42
+ });
43
+
44
+ const server = new McpServer({
45
+ name: 'umtri-mcp',
46
+ version: VERSION,
47
+ });
48
+
49
+ registerTools(server, { api });
50
+ registerResources(server, { resourcesDir: RESOURCES_DIR });
51
+
52
+ const transport = new StdioServerTransport();
53
+ await server.connect(transport);
54
+ console.error('[umtri-mcp] connected via stdio');