Agent Shaper MCP Server

Agent Shaper extracts per-module tensor shape metadata from any PyTorch `nn.Module` and uses it to annotate source files — either with descriptive

Local serverstdioPython

What is the Agent Shaper MCP server?

Agent Shaper MCP server is a locally run integration for AI assistants that speak the Model Context Protocol. Agent Shaper extracts per-module tensor shape metadata from any PyTorch nn.Module and uses it to annotate source files — either with descriptive shape comments or by rewriting operations as torch.einsum / einops.

What the assistant can call

Once Agent Shaper is connected, these are the calls the assistant has available:

  • dim_names — The optional dim_names parameter maps symbolic names to their concrete values in the example run. This lets the shape annotations show (B, T, n_embd)

Configuration and credentials

You will need 3 environment variables: OPENAI_API_KEY, OPENAI_MODEL, OPENAI_BASE_URL. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Setting it up

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client.

Choosing this one

This sits in the developer tooling group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Agent Shaper's toolset — dim_names — is a fair guide to whether it matches your workflow. It is maintained by athe-kunal; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Agent Shaper's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the agent shaper mcp server does with a few real requests.

Available tools

ToolWhat it does
dim_namesThe optional dim_names parameter maps symbolic names to their concrete values in the example run. This lets the shape annotations show (B, T, n_embd) instead of (2, 16, 64). When two names share the same value (e.g. B=2

Configuration

VariableDescriptionRequired
OPENAI_API_KEYCredential the server authenticates with.Yes
OPENAI_MODELConfiguration value read at startup.Optional
OPENAI_BASE_URLEndpoint or connection string the server talks to.Yes

Example prompts to try

  • Use Agent Shaper to dim names.

Frequently asked questions

It connects Agent Shaper to MCP-compatible AI assistants such as Claude and Cursor, exposing 1 tool (dim_names) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Agent Shaper directly.