SI

shriinivas/inkmcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

79 stars 12 forks 质量 62 趋势 0AGPL-3.0

Inkscape MCP 服务器——通过模型上下文协议通过 AI 助手控制 Inkscape

概览

一个模型上下文协议(MCP)服务器,通过自然语言指令实现对 Inkscape 的实时控制。这使得像 Claude 这样的 AI 助手能够实时直接操作矢量图形。 - 🎯 - 直接操作运行中的 Inkscape 文档 - ⚡ - 实时通信 - 🚀 - 创建统一语法的任意 SVG 元素 - 🏗️ - 语义组织,自动 ID 碰撞处理 - 📐 - 在实时上下文中运行任意 inkex 代码 - 🖼️ - 带视口捕获的可视化反馈 - - 使用 Linux 专用的 D-Bus - 通过 TCP 套接字/命名管道支持跨平台 1. 访问发布页面 2.从最新版本下载inkmcp-extension.zip 3.将其解压到你的 Inkscape 扩展目录: 正常启动 Inkscape——扩展在菜单中隐藏,只能通过 D-Bus 访问。 :当AI客户端首次连接时,会自动:- 在~/中创建Python虚拟环境。

概述(AI 翻译)

一个模型上下文协议(MCP)服务器,通过自然语言指令实现对 Inkscape 的实时控制。这使得像 Claude 这样的 AI 助手能够实时直接操作矢量图形。

特色

  • 🎯 实时实例控制 - 直接操作运行中的 Inkscape 文档
  • ⚡ D-总线集成 - 实时通信
  • 🚀 通用元素创建 - 创建任何统一语法的SVG元素
  • 🏗️ 分层场景管理 - 语义组织,自动识别码碰撞处理
  • 📐 Python 代码执行 - 在实时上下文中运行任意 inkex 代码
  • 🖼️ 截图支持 - 带视口捕获的视觉反馈

平台支持

  • ** ⚠️ 目前仅支持 Linux** - 使用 D-Bus,这是 Linux 专用的
  • ** 🔮 未来**:通过TCP套接字/命名管道支持跨平台支持

快速启动

1.安装(仅限Linux)

  1. 前往发布页面
  2. 从最新版本下载inkmcp-extension.zip
  3. 将其解压到你的 Inkscape 扩展目录中:

2.让脚本可执行

3.启动Inkscape

正常启动 Inkscape——扩展在菜单中隐藏,只能通过 D-Bus 访问。

4.

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Inkscape MCP Server

A Model Context Protocol (MCP) server that enables live control of Inkscape through natural language instructions. This allows AI assistants like Claude to directly manipulate vector graphics in real-time.

Features

  • 🎯 Live Instance Control - Direct manipulation of running Inkscape documents
  • ⚡ D-Bus Integration - Real-time communication
  • 🚀 Universal Element Creation - Create any SVG element with unified syntax
  • 🏗️ Hierarchical Scene Management - Semantic organization with automatic ID collision handling
  • 📐 Python Code Execution - Run arbitrary inkex code in live context
  • 🖼️ Screenshot Support - Visual feedback with viewport capture

Platform Support

  • ⚠️ Currently Linux Only - Uses D-Bus which is Linux-specific
  • 🔮 Future: Cross-platform support possible via TCP sockets/named pipes

Quick Start

1. Installation (Linux Only)

  1. Go to the Releases page
  2. Download inkmcp-extension.zip from the latest release
  3. Extract it to your Inkscape extensions directory:
    cd ~/.config/inkscape/extensions/
    unzip ~/Downloads/inkmcp-extension.zip
    

2. Make Scripts Executable

cd ~/.config/inkscape/extensions/inkmcp
chmod +x run_inkscape_mcp.sh inkmcpcli.py inkscape_mcp_server.py main.py

3. Start Inkscape

Launch Inkscape normally - the extension is hidden from the menu and only accessible via D-Bus.

4. Connect with AI Tools

Auto-Setup: The first time an AI client connects, it will automatically:

  • Create Python virtual environment in ~/.config/inkscape/extensions/inkmcp/venv/
  • Install all required dependencies from requirements.txt
  • Start the MCP server

No manual setup required!

Claude Code

Edit your Claude configuration file:

# ~/.claude/claude-config.json
{
  "mcpServers": {
    "inkscape": {
      "command": "/home/USERNAME/.config/inkscape/extensions/inkmcp/run_inkscape_mcp.sh"
    }
  }
}

Anthropic Claude Desktop

Update Claude desktop app settings:

{
  "mcpServers": {
    "inkscape": {
      "command": "/home/USERNAME/.config/inkscape/extensions/inkmcp/run_inkscape_mcp.sh"
    }
  }
}

Google Gemini/Codex

For Gemini, edit settings file:

# ~/.gemini/settings.json
{
  "mcpServers": {
    "inkscape-mcp": {
      "command": "/home/USERNAME/.config/inkscape/extensions/inkmcp/run_inkscape_mcp.sh"
    }
  }
}

For Codex, edit configuration:

# ~/.codex/config.toml
[mcp_servers.inkscape-mcp]
command = "/home/USERNAME/.config/inkscape/extensions/inkmcp/run_inkscape_mcp.sh"

Usage Examples

With AI Assistant (Claude Code/Gemini/etc) - Requires Running Inkscape

"In Inkscape, draw a smooth sine wave starting at the left edge in the middle of the document and apply power stroke path effect to it"
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "inkscape": { "command": "/home/USERNAME/.config/inkscape/extensions/inkmcp/run_inkscape_mcp.sh" } } }