
h0rv/d2-mcp
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
D2: Declarative Diagramming과 함께 일하는 모델 Context Protocol (MCP) 서버는 개발 워크플로우에 다이어그램 생성 및 검증의 원활한 통합을 가능하게 합니다.
개요
D2: Declarative Diagramming과 함께 일하는 모델 Context Protocol (MCP) 서버는 개발 워크플로우에 다이어그램 생성 및 검증의 원활한 통합을 가능하게 합니다. * Compile D2 Code * 렌더링하기 전에 유효 D2 구문 및 캐치 오류 * 다이어그램 구조 및 구문에 즉각적인 피드백을 얻기 * D2 파일에 직접 코드 또는 파일 경로를 수락 * Diagrams * 시각적 피드백 및 refinement에 대한 다이어그램을 생성 * PNG, SVG 및 ASCII 출력 형식 지원 * D2 파일에 직접 코드 또는 파일 경로를 수락 * Fetch D2 Cheat Sheet * Markdown 참조 덮음 모양, ling 스타일 사용 및 수송 및 전송 해당 MCP 클라이언트에 d2 MCP 서버를 추가하십시오. 서버는 librsvg에서 rsvg-convert가 사용할 때 기본적으로 PNG 출력을 반환합니다. rsvg-convert가 누락되면 서버는 렌더링-d2 도구의 형식의 enum에서 png를 자동으로 제거하고 SVG로 돌아갑니다.
개요(AI 번역)
검증 및 렌더링을위한 작은 이동 MCP 서버 D2 다이어그램. 완전한 소스 및 렌더링 옵션을 전송; PNG, SVG, 또는 텍스트를 수신. 기본 서버는 문서, artifacts, 또는 HTTP 세션이 없습니다. D2 실행, 브라우저 또는 PNG 변환기가 필요하지 않습니다.
** d2-mcp 2.0.0**는 D2 0.9.0, Go 1.27.2 및 공식 Go MCP SDK 1.8.0를 사용합니다. D2의 Dagre, ELK 및 오픈 소스 TALA 레이아웃은 번들됩니다. 입력 및 제한을 참조하십시오.
설치
소스에서 2.0.0 바이너리 또는 빌드를 설치 한 다음 Claude, Codex, Pi 또는 VS Code를 연결하십시오. 2.0.0 및 1.2.0 마이그레이션 노트에서 배송하는 것을보십시오.
바이너리를 설치하지 않고 호스팅 사용을 위해 https://d2.horv.co/mcp]
원격 HTTP 클라이언트 명령을 사용하여.
클라이언트와 수송
Stdio는 기본적으로 남아 있습니다. Claude Desktop 또는 기타 클라이언트를 위해 mcpServers:
stateless Streamable HTTP 엔드포인트의 경우:
Streamable HTTP MCP 클라이언트를 http://127.0.0.1:8080/mcp에 연결합니다. 예를 들어, VS Code .vscode/mcp.json 항목:
HTTP는 JSON 응답, 세션 ID 및 배경 이벤트 스트림을 사용합니다. 모든 통화는 소스/옵션을 운반합니다. 이후 통화는 다른 복제로 이동할 수 있습니다. GET/DELETE 에 /mcp 반환 405.
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
d2-mcp
A small Go MCP server for validating and rendering D2 diagrams. Send complete source and rendering options; receive PNG, SVG, or text. The default server keeps no documents, artifacts, or HTTP sessions. It needs no D2 executable, browser, or PNG converter.
d2-mcp 2.0.0 uses D2 0.9.0, Go 1.27.2, and the official Go MCP SDK 1.8.0. D2’s Dagre, ELK, and open-source TALA layouts are bundled. See inputs and limits.
Install
Install a 2.0.0 binary or build from source, then connect Claude, Codex, Pi, or VS Code. See what shipped in 2.0.0 and the 1.2.0 migration notes.
For hosted use without installing a binary, connect to https://d2.horv.co/mcp
using the remote HTTP client commands.
Clients and transports
Stdio remains the default. For Claude Desktop or another client using mcpServers:
{
"mcpServers": {
"d2": {
"command": "/absolute/path/d2-mcp",
"args": ["--image-type", "png"]
}
}
}
For a stateless Streamable HTTP endpoint:
./d2-mcp --transport http --host 127.0.0.1 --port 8080
Connect a Streamable HTTP MCP client to http://127.0.0.1:8080/mcp. For example, a VS Code .vscode/mcp.json entry:
{
"servers": {
"d2": {"type": "http", "url": "http://127.0.0.1:8080/mcp"}
}
}
HTTP uses JSON responses, no session ID, and no background event stream. Every call carries its source/options; subsequent calls may go to another replica. GET/DELETE on /mcp return 405. Current MCP 2026-07-28 discovery and legacy initialization are handled by the SDK; integration tests cover 2025-03-26, 2025-06-18, 2025-11-25, and 2026-07-28 over HTTP. Stdio and legacy SSE retain their supported initialization protocols.
Send exactly one JSON-RPC object per HTTP POST. Batches are rejected on every protocol version, including legacy SSE message posts, to prevent unbounded aggregation of tool results. Disconnects cancel current-protocol (2026-07-28) work cooperatively; the SDK retains older protocol calls until their application deadline.
Legacy SSE remains available at /sse with --transport sse (or --sse). Its SDK-managed connections are stateful and need a stable server connection. Prefer HTTP for new integrations. MCP_TRANSPORT, PORT, and legacy SSE_MODE/SSE_PORT are still accepted; explicit transport/port flags take precedence, and --sse selects SSE.
설치
docker run --rm -i d2-mcp설정
{
"mcpServers": {
"d2": {
"command": "/absolute/path/d2-mcp",
"args": ["--image-type", "png"]
}
}
}