@thinkdata/mcp-server 0.2.0 → 0.3.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 CHANGED
@@ -1,52 +1,50 @@
1
1
  {
2
- "name": "@thinkdata/mcp-server",
3
- "version": "0.2.0",
4
- "description": "ThinkERD MCP Server — AI agents can query your database schema",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "bin": {
9
- "thinkerd-mcp": "./dist/index.js"
10
- },
11
- "files": [
12
- "dist",
13
- "README.md"
14
- ],
15
- "publishConfig": {
16
- "access": "public"
17
- },
18
- "repository": {
19
- "type": "git",
20
- "url": "https://github.com/Thinkdata-dev/thinkdata",
21
- "directory": "packages/mcp-server"
22
- },
23
- "homepage": "https://thinkdata.dev",
24
- "scripts": {
25
- "build": "esbuild src/index.ts --bundle --platform=node --format=esm --outfile=dist/index.js --banner:js=\"import{createRequire as __cr}from'module';import{fileURLToPath as __f}from'url';import{dirname as __d}from'path';const require=__cr(import.meta.url);const __filename=__f(import.meta.url);const __dirname=__d(__filename);\" && tsc --emitDeclarationOnly",
26
- "dev": "tsx src/index.ts",
27
- "typecheck": "tsc --noEmit",
28
- "prepublishOnly": "npm run build",
29
- "smoke": "node scripts/smoke.mjs",
30
- "test": "vitest run"
31
- },
32
- "keywords": [
33
- "mcp",
34
- "model-context-protocol",
35
- "erd",
36
- "database",
37
- "schema",
38
- "thinkerd"
39
- ],
40
- "license": "MIT",
41
- "dependencies": {},
42
- "devDependencies": {
43
- "@types/node": "^20.14.0",
44
- "esbuild": "^0.28.0",
45
- "tsx": "^4.19.0",
46
- "typescript": "^5.4.5",
47
- "@modelcontextprotocol/sdk": "^1.12.1",
48
- "zod": "^3.23.8",
49
- "@thinkdata/semantic-core": "workspace:*",
50
- "vitest": "^3.2.4"
51
- }
2
+ "name": "@thinkdata/mcp-server",
3
+ "version": "0.3.0",
4
+ "description": "ThinkERD MCP Server — AI agents can query your database schema",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "bin": {
9
+ "thinkerd-mcp": "./dist/index.js"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "README.md"
14
+ ],
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/Thinkdata-dev/thinkdata",
21
+ "directory": "packages/mcp-server"
22
+ },
23
+ "homepage": "https://thinkdata.dev",
24
+ "scripts": {
25
+ "build": "esbuild src/index.ts --bundle --platform=node --format=esm --outfile=dist/index.js --banner:js=\"import{createRequire as __cr}from'module';import{fileURLToPath as __f}from'url';import{dirname as __d}from'path';const require=__cr(import.meta.url);const __filename=__f(import.meta.url);const __dirname=__d(__filename);\" && tsc --emitDeclarationOnly",
26
+ "dev": "tsx src/index.ts",
27
+ "typecheck": "tsc --noEmit",
28
+ "prepublishOnly": "npm run build",
29
+ "smoke": "node scripts/smoke.mjs",
30
+ "test": "echo \"계약 테스트는 @thinkdata/cli 로 이관됨 (src/mcp/__tests__)\" && exit 0"
31
+ },
32
+ "keywords": [
33
+ "mcp",
34
+ "model-context-protocol",
35
+ "erd",
36
+ "database",
37
+ "schema",
38
+ "thinkerd"
39
+ ],
40
+ "license": "MIT",
41
+ "dependencies": {},
42
+ "devDependencies": {
43
+ "@types/node": "^20.14.0",
44
+ "esbuild": "^0.28.0",
45
+ "tsx": "^4.19.0",
46
+ "typescript": "^5.4.5",
47
+ "vitest": "^3.2.4",
48
+ "@thinkdata/cli": "workspace:*"
49
+ }
52
50
  }
package/dist/client.d.ts DELETED
@@ -1,104 +0,0 @@
1
- /**
2
- * ThinkERD API Client
3
- *
4
- * MCP Server가 ThinkERD 클라우드 API와 통신하기 위한 HTTP 클라이언트입니다.
5
- * PAT(Personal Access Token) 기반 인증을 사용합니다.
6
- *
7
- * @module client
8
- */
9
- export interface DiagramSummary {
10
- id: string;
11
- name: string;
12
- projectId: string;
13
- projectName?: string;
14
- entityCount: number;
15
- relationshipCount: number;
16
- updatedAt: string;
17
- }
18
- export interface EntityDetail {
19
- id: string;
20
- name: string;
21
- tableName: string;
22
- logicalName?: string;
23
- entityRole?: string;
24
- columns: ColumnDetail[];
25
- }
26
- export interface ColumnDetail {
27
- id: string;
28
- name: string;
29
- logicalName?: string;
30
- type: string;
31
- isPrimaryKey?: boolean;
32
- isForeignKey?: boolean;
33
- isNullable?: boolean;
34
- defaultValue?: string;
35
- description?: string;
36
- }
37
- export interface RelationshipDetail {
38
- id: string;
39
- sourceEntityId: string;
40
- sourceEntityName: string;
41
- targetEntityId: string;
42
- targetEntityName: string;
43
- type: string;
44
- sourceCardinality: string;
45
- targetCardinality: string;
46
- }
47
- export interface DictionaryWord {
48
- id: string;
49
- logicalName: string;
50
- physicalName: string;
51
- /**
52
- * 사내에서 이 단어를 부르는 다른 말.
53
- *
54
- * 사용자가 가장 많이 채우는 필드인데 온톨로지 `skos:altLabel`에는 실리지 않으므로,
55
- * **이 창구가 사내 표준 어휘가 외부 AI에 닿는 유일한 경로다.**
56
- */
57
- synonyms?: string[];
58
- /** `'classifier'` | `'modifier'` — 컬럼이 아니라 `word_type`의 값이다 */
59
- classifier?: string;
60
- }
61
- export declare class ThinkERDClient {
62
- private readonly baseUrl;
63
- private readonly headers;
64
- constructor(apiUrl: string, token: string);
65
- private request;
66
- /** 사용자의 모든 다이어그램 목록 조회 */
67
- listDiagrams(): Promise<DiagramSummary[]>;
68
- /** 다이어그램 상세 (엔터티 + 관계 포함) */
69
- getDiagram(diagramId: string): Promise<{
70
- diagram: DiagramSummary;
71
- entities: EntityDetail[];
72
- relationships: RelationshipDetail[];
73
- }>;
74
- /** 단일 엔터티 상세 조회 */
75
- getEntity(diagramId: string, entityId: string): Promise<EntityDetail>;
76
- /** 엔터티 이름으로 검색 */
77
- searchEntities(diagramId: string, query: string): Promise<EntityDetail[]>;
78
- /** 다이어그램의 DDL 생성 */
79
- generateDDL(diagramId: string, dialect?: string): Promise<string>;
80
- /** 표준 사전 단어 목록 */
81
- getDictionary(projectId: string): Promise<DictionaryWord[]>;
82
- /** 스키마 변경 제안 (Draft 생성) */
83
- proposeSchemaChange(diagramId: string, data: {
84
- entityName: string;
85
- changeType: string;
86
- changeData: Record<string, unknown>;
87
- reason: string;
88
- }): Promise<{
89
- draft_id: string;
90
- status: string;
91
- }>;
92
- private postRequest;
93
- /** 자연어 질문 → 관련 엔터티 컨텍스트 (Graph RAG) */
94
- getProjectContext(projectId: string, question: string): Promise<any>;
95
- /** 두 엔터티 간 JOIN 경로 탐색 */
96
- findJoinPath(projectId: string, from: string, to: string): Promise<any>;
97
- /** 프로젝트 전체 스키마 요약 */
98
- getProjectSummary(projectId: string): Promise<any>;
99
- /** 메타데이터 풍부도 품질 보고 */
100
- checkMetadataQuality(projectId: string): Promise<any>;
101
- /** SPARQL 직접 실행 */
102
- queryOntology(projectId: string, query: string): Promise<any>;
103
- }
104
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,YAAY,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAA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AO,CAAC,GAAG,CAAC;CAGtE"}
@@ -1,12 +0,0 @@
1
- /**
2
- * MCP Resources 등록
3
- *
4
- * Resources는 읽기 전용 데이터를 노출합니다.
5
- * AI 에이전트가 ThinkERD의 스키마 정보를 컨텍스트로 가져갈 수 있습니다.
6
- *
7
- * @module resources
8
- */
9
- import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
10
- import type { ThinkERDClient } from './client.js';
11
- export declare function registerResources(server: McpServer, client: ThinkERDClient): void;
12
- //# sourceMappingURL=resources.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../src/resources.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,CAgJjF"}
@@ -1,20 +0,0 @@
1
- /**
2
- * 배송되는 도구 목록의 **정본**.
3
- *
4
- * ## 왜 목록을 따로 적는가
5
- *
6
- * 2026-08-29 점검에서 **레포에 18종, npm에 5종**이 있는 것이 발견됐다. 13종은 한
7
- * 번도 배송된 적이 없었다. 원인은 배포 자동화가 태그를 밀 때만 도는데 **태그 미는
8
- * 것을 잊은 것**이고, 더 근본적으로는 "레포에 있는 것"과 "실제로 나간 것"을
9
- * **아무도 대조하지 않은 것**이다.
10
- *
11
- * 그래서 대조를 사람이 아니라 테스트가 한다. 도구를 추가·삭제하면 이 파일도 같이
12
- * 고쳐야 하고, 안 고치면 `toolContract.test.ts`가 실패한다.
13
- *
14
- * `@thinkdata/governance-types`의 `copilot-actions.ts`가 액션 프로토콜에 대해
15
- * 하는 역할과 같다 (CLAUDE.md §4.5).
16
- */
17
- /** 등록되는 도구 이름 — `registerTools`와 정확히 일치해야 한다 */
18
- export declare const TOOL_MANIFEST: readonly ["get_entity", "search_entities", "generate_ddl", "validate_schema", "harvest_schema_semantics", "propose_schema_change", "get_business_dictionary", "analyze_legacy_sql", "semantic_search", "get_business_context", "generate_sql", "get_project_context", "find_join_path", "get_project_summary", "query_ontology", "check_metadata_quality"];
19
- export type ToolName = (typeof TOOL_MANIFEST)[number];
20
- //# sourceMappingURL=toolManifest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toolManifest.d.ts","sourceRoot":"","sources":["../src/toolManifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,gDAAgD;AAChD,eAAO,MAAM,aAAa,4VAmBhB,CAAA;AAEV,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAA"}
package/dist/tools.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import type { ThinkERDClient } from './client.js';
3
- export declare function registerTools(server: McpServer, client: ThinkERDClient): void;
4
- //# sourceMappingURL=tools.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,cAAc,GAAG,IAAI,CA0vB7E"}