Skip to main content
Glama
Pankaj-Deswal

battery-analyzer-mcp

Battery Analyzer MCP Server

An MCP (Model Context Protocol) server that exposes Dunn and GITT battery analysis calculations to AI assistants like Cursor and Claude Desktop.

This package is fully standalone — calculation code is copied here and does not import from battery-analyzer/.

Tools

Tool

Description

list_battery_methods

List available methods and expected Excel input formats

list_data_files_tool

List .xlsx files in the data folder

calculate_dunn

Run Dunn method (K1, K2, b values) on cyclic voltammetry data

calculate_gitt

Run GITT method (diffusion coefficients) on titration data

Related MCP server: MOF Tools MCP Server

Data folder

Place input Excel files in:

battery-analyzer-mcp/data/

Tools take only the file name (not a full path), for example dunn_method_data.xlsx. The .xlsx extension is optional.

Results are saved in the same data/ folder next to the input file.

Override the data folder with the BATTERY_ANALYZER_DATA_DIR environment variable if needed.

Input file formats

Dunn method

No header row in the Excel file:

Col 1+

Row 0

Scan rates (V/s)

Row 1

(unused)

Row 2+

Voltage (V) in col 0

Current (A) per scan rate

GITT method

  • Skip first skip_rows metadata rows (default: 6)

  • Column 0: time (s)

  • Column 1: voltage (V)

Install

Requires Python 3.10+ and uv:

cd battery-analyzer-mcp
uv sync

Run locally(if needed in case of local mcp client)

uv run battery-analyzer-mcp

Or with MCP Inspector for development:

uv run mcp dev src/battery_analyzer_mcp/server.py

Cursor MCP configuration

Claude Desktop configuration

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "battery-analyzer": {
      "command": "uv",
      "args": [
        "--directory",
        "<absolute path to your directory>/battery-analyzer-mcp",
        "run",
        "battery-analyzer-mcp"
      ]
    }
  }
}

Restart Claude Desktop after saving.

Troubleshooting

Failed to spawn process: No such file or directory

Claude Desktop / Cursor could not find the command binary. GUI apps use a limited PATH and usually cannot resolve bare uv. Fix:

  1. Run cd battery-analyzer-mcp && uv sync to create .venv/

  2. Use the full path to .venv/bin/battery-analyzer-mcp as the command (see Option A above)

  3. Or use the full path to uv (e.g. /Users/pankaj/anaconda3/bin/uv) instead of just "uv"

Example tool calls

List methods:

list_battery_methods()

List available input files:

list_data_files_tool()

Dunn calculation:

calculate_dunn(file_name="dunn_method_data.xlsx")

GITT calculation:

calculate_gitt(
  file_name="GITT_67.xlsx",
  skip_rows=6,
  L=1e-4,
  tau=1800
)

Output

Each calculation tool returns a compact JSON response (under Claude Desktop's 1 MB MCP limit):

  • results_path — path to the saved Excel file (*_dunn_results.xlsx or *_gitt_results.xlsx)

  • message — status message

  • preview — first rows of core results (Dunn: Voltage, K1, K2, b only)

  • plots — plot titles and series metadata only (no x/y coordinates)

  • summary — method-specific metadata

  • note — explains that full data is in the Excel file

Full numeric results and all columns are always written to results_path. Open that Excel file for complete data and plotting.

Results Excel files are written to the data/ folder next to the input file.

Dependencies

  • mcp[cli] — MCP Python SDK

  • pandas, numpy, scipy, openpyxl — calculation and Excel I/O

Available Tools

4 tools
calculate_dunnA

Run the Dunn method on a cyclic voltammetry Excel file from the data folder.

Args: file_name: File name in the data folder (e.g. dunn_method_data.xlsx). .xlsx is added if omitted. max_plot_points: Maximum number of points per plot series (default 5000).

Returns: JSON with results_path, preview table, plots, and summary.

ParametersJSON Schema
NameRequiredDescriptionDefault
file_nameYes
max_plot_pointsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses that .xlsx extension is added if omitted and specifies the return structure, but fails to mention error handling, file existence requirements, or whether the tool modifies data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise yet complete, using a clear docstring format with summary, Args, and Returns sections. Every sentence adds necessary information without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 2 parameters, no annotations, and an output schema (which explains return values), the description covers the basics but lacks details like required file format, error handling, and prerequisite conditions. Could be more robust.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description adds meaningful context for both parameters: file_name explains the data folder and automatic .xlsx addition, and max_plot_points explains default and purpose. This adds significant value beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool runs the Dunn method on cyclic voltammetry Excel files from a data folder, using a specific verb and resource. It distinguishes itself from siblings like calculate_gitt (for GITT) and list_data_files_tool (for listing files).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context (cyclic voltammetry Excel files) but does not explicitly state when to use this tool over alternatives like calculate_gitt or list_battery_methods. No exclusion criteria or when-not-to-use guidance is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

calculate_gittA

Run the GITT method on a titration Excel file from the data folder.

Args: file_name: File name in the data folder (e.g. GITT_67.xlsx). .xlsx is added if omitted. skip_rows: Number of metadata rows to skip at the top (default 6). L: Electrode thickness in cm (default 1e-4). threshold: Minimum dV to classify segment direction in V (default 1e-4). min_points: Minimum points per voltage segment (default 5). tau: Pulse duration in seconds (default 1800). max_plot_points: Maximum number of points per plot series (default 5000).

Returns: JSON with results_path, preview table, plots, and summary.

ParametersJSON Schema
NameRequiredDescriptionDefault
LNo
tauNo
file_nameYes
skip_rowsNo
thresholdNo
min_pointsNo
max_plot_pointsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the full burden. It does not disclose side effects, authentication needs, or whether the tool modifies data. The description focuses on parameters and return value, but lacks behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with Args and Returns sections, and the main purpose is front-loaded. It is slightly verbose but every sentence adds value. Could be tightened slightly, but overall good.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers all parameters, default values, and the return format. It references the data folder, which provides context. However, it does not mention prerequisites such as file existence or format, or error handling. Output schema exists, so return details are sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description adds substantial meaning. Each parameter is explained with its purpose, default value, and units (e.g., 'Electrode thickness in cm'). The note about '.xlsx added if omitted' adds practical semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool runs the GITT method on an Excel file, specifying the verb 'Run' and the resource 'titration Excel file'. It distinguishes from siblings like 'calculate_dunn' which likely runs a different method.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide guidance on when to use this tool versus alternatives such as 'calculate_dunn'. There is no explanation of prerequisites or scenarios where this method is appropriate.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_battery_methodsA

List available battery analysis methods and their expected Excel input formats.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavior. It states 'list', implying a read-only operation, but does not elaborate on data sources or confirm no side effects. With zero parameters and an output schema, the behavior is straightforward but minimally described.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence that front-loads the key information. No unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no parameters, an output schema exists, and the sibling tools are clearly different, the description is complete. It sufficiently informs the agent of the tool's purpose and output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are no parameters, so the baseline is 4. The description adds value by specifying that the output includes battery analysis methods and their Excel input formats, which is useful context beyond the empty schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: listing available battery analysis methods and their expected Excel input formats. It uses a specific verb ('list') and resource ('battery analysis methods'), and it distinguishes from sibling tools like calculate_dunn and list_data_files_tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implicitly indicates usage: to discover available methods and input formats. It does not explicitly state when not to use it or provide alternatives, but the sibling context makes the differentiation clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_data_files_toolA

List .xlsx input files available in the MCP server data folder.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, and the description does not disclose behavioral traits such as read-only nature or performance implications. For a simple listing tool, minimal transparency is acceptable but not ideal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence with no wasted words, perfectly front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no parameters and an output schema, the description sufficiently explains the tool's function. No additional details are necessary.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are no parameters, so the schema covers 100% of input. The description adds no param info but none is needed; baseline score of 4 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'List', specifies the resource '.xlsx input files', and the location 'MCP server data folder'. It is specific and distinguishable from sibling tools like calculate_dunn.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The purpose is self-evident and siblings are different, so usage is clear. However, no explicit when/when-not guidance is provided, which could be improved.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updatesv0.1.0
    • First observedcalculate_dunn
    • First observedcalculate_gitt
    • First observedlist_battery_methods
    • First observedlist_data_files_tool

TDQS

A4/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a distinct purpose: two specific calculation methods (Dunn, GITT) plus two listing tools (methods, data files). No ambiguity between them.

Naming Consistency4/5

All tool names use snake_case with verb_noun pattern (calculate_, list_). Only minor inconsistency is 'list_data_files_tool' includes the word 'tool', but overall pattern is clear.

Tool Count5/5

Four tools is appropriate for a specialized battery analyzer MCP. Not too few, not too many, covering core functionality without bloat.

Completeness4/5

Covers listing methods/data and running two major analysis methods. Missing a generic 'run analysis' tool that selects method, but list_battery_methods helps guide the agent. Minor gap.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A specialized MCP server for Metal-Organic Framework research that provides tools for database searching, structural optimization, and energy calculations via ASE. It enables scientific workflows by allowing users to interact with MOF data and perform chemical simulations through a standard SSE interface.
    MIT
  • A
    license
    B
    quality
    C
    maintenance
    Fits a lithium-ion full-cell dual-water-tank model from charge/discharge voltage-capacity data for battery aging mechanism identification, with parameter fitting, batch processing, and MCP server integration.
    3
    4
    Apache 2.0