@thinkdata/mcp-server
v0.1.0
Published
ThinkERD MCP Server — AI agents can query your database schema
Maintainers
Readme
@thinkdata/mcp-server
ThinkERD MCP Server — AI agents can query your database schema
외부 AI 에이전트(Cursor, Windsurf, Claude Desktop 등)가 ThinkERD의 ERD 스키마를 실시간으로 조회하고, 스키마 변경을 제안할 수 있는 Model Context Protocol (MCP) 서버입니다.
주요 기능
- Schema Read — 다이어그램의 엔터티, 컬럼, 관계를 AI 에이전트의 컨텍스트로 제공
- DDL 생성 — PostgreSQL, MySQL, Oracle, MSSQL, SQLite DDL 자동 생성
- 스키마 검증 — PK 누락, 고립 엔터티, 빈 테이블 등 자동 점검
- 스키마 변경 제안 — AI가 코드를 작성하다 필요한 스키마 변경을 ThinkERD에 Draft로 전송
빠른 시작
1. 토큰 발급
ThinkERD 캔버스 → IDE 연동(MCP) 버튼 → 토큰 발급
또는 API로 직접 발급:
curl -X POST https://app.thinkdata.dev/api/tokens \
-H "Authorization: Bearer <YOUR_JWT>" \
-H "Content-Type: application/json" \
-d '{"name": "My MCP Token", "scopes": ["read", "write"]}'2. IDE 설정
Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"thinkerd": {
"command": "npx",
"args": ["-y", "@thinkdata/mcp-server", "--api-url", "https://app.thinkdata.dev", "--token", "<YOUR_TOKEN>"]
}
}
}Windsurf (~/.codeium/windsurf/mcp_config.json)
{
"mcpServers": {
"thinkerd": {
"command": "npx",
"args": ["-y", "@thinkdata/mcp-server", "--api-url", "https://app.thinkdata.dev", "--token", "<YOUR_TOKEN>"]
}
}
}Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json)
{
"mcpServers": {
"thinkerd": {
"command": "npx",
"args": ["-y", "@thinkdata/mcp-server", "--api-url", "https://app.thinkdata.dev", "--token", "<YOUR_TOKEN>"]
}
}
}3. 사용 예시
AI 채팅에서 다음과 같이 요청하세요:
- "ThinkERD에서 결제 관련 테이블 스키마를 가져와서 TypeORM 엔티티 코드를 만들어줘"
- "ThinkERD 다이어그램의 DDL을 PostgreSQL로 생성해줘"
- "ThinkERD 스키마를 검증해서 문제가 있는지 확인해줘"
Resources (읽기 전용)
| Resource URI | 설명 |
|---|---|
| thinkerd://diagrams | 모든 다이어그램 목록 |
| thinkerd://diagrams/{id}/schema | 다이어그램 전체 스키마 (JSON) |
| thinkerd://diagrams/{id}/entities/{id} | 단일 엔터티 상세 |
| thinkerd://diagrams/{id}/ddl | DDL 생성 |
| thinkerd://projects/{id}/dictionary | 표준 사전 |
Tools (액션 실행)
| Tool | 설명 |
|---|---|
| get_entity | 엔터티 상세 조회 |
| search_entities | 엔터티 이름 검색 |
| generate_ddl | DDL 생성 (5개 DBMS 지원) |
| validate_schema | 스키마 검증 |
| propose_schema_change | 스키마 변경 제안 (Draft) |
환경변수
| 변수 | 설명 | 기본값 |
|---|---|---|
| THINKERD_API_URL | ThinkERD API URL | https://app.thinkdata.dev |
| THINKERD_TOKEN | Personal Access Token | — |
보안
- 토큰은 SHA-256 해시로만 서버에 저장됩니다
- 기본 발급 시
read스코프만 부여됩니다 - 워크스페이스/프로젝트 단위로 접근 범위를 제한할 수 있습니다
- 토큰 만료일을 설정할 수 있습니다 (기본 90일)
라이선스
MIT
