MCP server for drawing tensors with tensordiagram
Project description
tensordiagram mcp server
mcp server that enables AI assistants like Claude to draw diagrams of tensors.
overview
This mcp server provides the draw_tensor tool, allowing LLMs to create clear, visual representations of tensors to help users understand tensor shapes, operations, and dimensional transformations. Built on top of tensordiagram and FastMCP.
install
option 1: PyPI
pip install tensordiagram-mcp
option 2: from source
git clone https://github.com/hardik-vala/tensordiagram.git
cd tensordiagram/mcp
pip install -e .
option 3: Docker
git clone https://github.com/hardik-vala/tensordiagram.git
cd tensordiagram/mcp
docker build -t tensordiagram/mcp:latest .
docker run -i --rm --name tensordiagram-mcp tensordiagram/mcp:latest
configuration
Claude Desktop
Add this to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
using pip installation
{
"mcpServers": {
"tensordiagram": {
"command": "python",
"args": ["-m", "tensordiagram_mcp"]
}
}
}
using local installation
{
"mcpServers": {
"tensordiagram": {
"command": "python",
"args": ["/path/to/tensordiagram/mcp/server.py"]
}
}
}
using Docker
{
"mcpServers": {
"tensordiagram": {
"command": "docker",
"args": ["run", "-i", "--rm", "--name", "tensordiagram-mcp", "tensordiagram/mcp:latest"]
}
}
}
After updating the configuration, restart Claude Desktop.
usage
Once installed, Claude can use the draw_tensor tool to create visualizations. Here are some examples:
example prompts
"Can you show me what a 3x4 tensor looks like?" "Draw a 2x3x4 tensor in coral color" "Visualize a 3x3 identity matrix with the actual values shown" "Create a diagram of a 4x6 tensor with dimension sizes and indices labeled"
technical details
- minimum width: all output images are scaled to at least 400px width for readability
- size limit: images are capped at ~900KB to comply with MCP's 1MB message limit
- image format: PNG with white background
- dependencies: requires pycairo for PNG rendering
license
MIT License - see the main tensordiagram repository for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tensordiagram_mcp-0.1.0.tar.gz.
File metadata
- Download URL: tensordiagram_mcp-0.1.0.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f23ae79ee847fe018940ba92d2f881e870f43608954af59f74d4bdef7f4946fe
|
|
| MD5 |
23a6643692d2ea2eefe72692e1f3561e
|
|
| BLAKE2b-256 |
f37fb5cbd7d51680f663eba34d2ed2179f8ec2ee0eda33905c215686a42f8e8f
|
Provenance
The following attestation bundles were made for tensordiagram_mcp-0.1.0.tar.gz:
Publisher:
publish-mcp.yml on hardik-vala/tensordiagram
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tensordiagram_mcp-0.1.0.tar.gz -
Subject digest:
f23ae79ee847fe018940ba92d2f881e870f43608954af59f74d4bdef7f4946fe - Sigstore transparency entry: 730372644
- Sigstore integration time:
-
Permalink:
hardik-vala/tensordiagram@008c618eb697c1238e11e862b4639f2a95c09fc1 -
Branch / Tag:
refs/tags/mcp-v0.1.0 - Owner: https://github.com/hardik-vala
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-mcp.yml@008c618eb697c1238e11e862b4639f2a95c09fc1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tensordiagram_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tensordiagram_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef5eca3f5cd395448390f3931d91470fcd6fbe20c44b1715bc63a261b3937744
|
|
| MD5 |
08e1d8b40a13533042788842d1c3aa45
|
|
| BLAKE2b-256 |
309e43f6699cae085f191f22c9a6477868f5f2fecce876200ef42d2d18809e7f
|
Provenance
The following attestation bundles were made for tensordiagram_mcp-0.1.0-py3-none-any.whl:
Publisher:
publish-mcp.yml on hardik-vala/tensordiagram
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tensordiagram_mcp-0.1.0-py3-none-any.whl -
Subject digest:
ef5eca3f5cd395448390f3931d91470fcd6fbe20c44b1715bc63a261b3937744 - Sigstore transparency entry: 730372647
- Sigstore integration time:
-
Permalink:
hardik-vala/tensordiagram@008c618eb697c1238e11e862b4639f2a95c09fc1 -
Branch / Tag:
refs/tags/mcp-v0.1.0 - Owner: https://github.com/hardik-vala
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-mcp.yml@008c618eb697c1238e11e862b4639f2a95c09fc1 -
Trigger Event:
push
-
Statement type: