Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tensordiagram_mcp-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tensordiagram_mcp-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

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

Hashes for tensordiagram_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f23ae79ee847fe018940ba92d2f881e870f43608954af59f74d4bdef7f4946fe
MD5 23a6643692d2ea2eefe72692e1f3561e
BLAKE2b-256 f37fb5cbd7d51680f663eba34d2ed2179f8ec2ee0eda33905c215686a42f8e8f

See more details on using hashes here.

Provenance

The following attestation bundles were made for tensordiagram_mcp-0.1.0.tar.gz:

Publisher: publish-mcp.yml on hardik-vala/tensordiagram

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tensordiagram_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tensordiagram_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef5eca3f5cd395448390f3931d91470fcd6fbe20c44b1715bc63a261b3937744
MD5 08e1d8b40a13533042788842d1c3aa45
BLAKE2b-256 309e43f6699cae085f191f22c9a6477868f5f2fecce876200ef42d2d18809e7f

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page