svgwriter-mcp
Provides tools to create, compose, and export SVG documents using the svgwrite library, including shapes, groups, gradients, patterns, and text.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@svgwriter-mcpCreate an SVG document with a blue circle and Hello text"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
svgwriter-mcp
An MCP server that wraps the svgwrite Python library, enabling LLM agents to create, compose, and export SVG documents through tool calls.
Features
21 tools covering the full SVG creation workflow
In-memory document state — create multiple documents in a session
Groups, gradients, shapes, text, paths, and pattern generators
Returns SVG as a string or saves directly to disk
Related MCP server: Excalidraw MCP Server
Installation
git clone <repo>
cd svgwriter-mcp
uv syncUsage
As an MCP server (stdio)
uv run python main.pyAs a library (direct function calls)
import json, server
result = json.loads(server.create_document(width="800px", height="600px"))
doc_id = result["doc_id"]
server.add_rect(doc_id=doc_id, x=0, y=0, width=800, height=600, fill="#eef")
server.add_text(doc_id=doc_id, text="Hello SVG", x=400, y=300, text_anchor="middle")
server.save_file(doc_id=doc_id, filepath="hello.svg")Run the demo
uv run python example.py
# produces example_output.svgMCP Client Configuration
Add to your Claude Desktop claude_desktop_config.json
(%APPDATA%\Claude\claude_desktop_config.json on Windows,
~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"svgwriter": {
"command": "uv",
"args": [
"run",
"python",
"/path/to/svgwriter-mcp/main.py"
]
}
}
}Note: Use the absolute path to
main.pyon your machine (e.g.C:\\Users\\you\\svgwriter-mcp\\main.pyon Windows). Using the full path avoids working-directory issues with Claude Desktop.
Tool Reference
Document Lifecycle
Tool | Description |
| Create a new SVG document; returns |
| List all open documents with their sizes |
| Delete a document and free its state |
| Return the SVG XML as a raw string |
| Return the SVG as an inline |
| Write the SVG to a file on disk |
Shapes
All shape tools accept an optional group_id to target a group instead of the document root.
Tool | Key Parameters |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Groups
Tool | Description |
| Create a |
| List all group ids in a document |
Gradients
Use the returned url_ref (e.g. url(#grad1)) as a fill value for shapes.
Tool | Description |
| Add a |
| Add a |
| List all gradients in a document |
Pattern Generators
Tool | Description |
| Grid of lines at |
| Alternating |
| Small circles at |
| Circles from |
Development
# Install with dev deps
uv sync --group dev
# Run tests
uv run pytest -v
# Syntax check
uv run python -c "import server; print('OK')"Response Format
All tools return a JSON string:
{"status": "ok", "doc_id": "doc_abc123"}
{"status": "error", "message": "Document 'x' not found."}This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/pouriamrt/svgwriter-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server