code-screenshot-mcp 是做什麼的?
🎨 使用此 MCP 伺服器生成美觀的語法高亮度程式碼截圖,專為與 Claude 無縫整合及專業主題設計。
功能特色
- 語法高亮度:自動偵測並突顯多種程式語言的語法。
- 專業主題:內建多種精美的佈景主題,適用於不同場景。
- 高度可自訂:可調整字型、背景顏色、行號等設定。
- 無縫整合:透過 MCP 協議與 Claude 和其他 AI 工具完美搭配。
- 快速生成:即時輸出高品質的 PNG 或 SVG 格式截圖。
安裝
透過 npm 或 yarn 安裝:
npm install -g @tommy0200/code-screenshot-mcp
或
yarn global add @tommy0200/code-screenshot-mcp
使用方式
- 啟動 MCP 伺服器:
code-screenshot-mcp --port 8080
-
在 Claude 或其他支援 MCP 的應用程式中設定連線。
-
使用以下指令生成截圖:
{
"code": "console.log('Hello, world!');",
"language": "javascript",
"theme": "dark"
}
設定選項
| 參數 | 類型 | 預設值 | 說明 |
|---|---|---|---|
theme | 字串 | onedark | 佈景主題名稱 |
fontSize | 數字 | 14 | 字型大小 |
showLineNumbers | 布林值 | true | 是否顯示行號 |
backgroundColor | 字串 | #282c34 | 背景顏色 |
format | 字串 | png | 輸出格式 (png 或 svg) |
支援的語言
- JavaScript, TypeScript, Python, Ruby, Go, Rust, Java, C++, 以及更多。
授權
本專案採用 MIT 授權條款。
貢獻
歡迎提交 Issue 或 Pull Request 來改善本工具。
🎉 使用 tommy0200/code-screenshot-mcp 輕鬆建立專業的程式碼截圖!