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.
Metadata
Release files for tensordiagram-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| tensordiagram_mcp-0.1.0.tar.gz | 5.5 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tensordiagram_mcp-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.2 kB
Release files / tensordiagram_mcp-0.1.0.tar.gz
| Download URL | tensordiagram_mcp-0.1.0.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f23ae79ee847fe018940ba92d2f881e870f43608954af59f74d4bdef7f4946fe
|
|
BLAKE2b-256 checksum How to use checksums |
f37fb5cbd7d51680f663eba34d2ed2179f8ec2ee0eda33905c215686a42f8e8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2025.
Transparency logRelease files / tensordiagram_mcp-0.1.0-py3-none-any.whl
| Download URL | tensordiagram_mcp-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ef5eca3f5cd395448390f3931d91470fcd6fbe20c44b1715bc63a261b3937744
|
|
BLAKE2b-256 checksum How to use checksums |
309e43f6699cae085f191f22c9a6477868f5f2fecce876200ef42d2d18809e7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2025.
Transparency logSecurity for tensordiagram-mcp 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for tensordiagram_mcp-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 28, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.