Generates LaTeX output for mathematical expressions and equations through the CAS system, with plans for LaTeX/PDF reporting
Generates Markdown reports from persisted physics computation sessions using the report tool
Built as a TypeScript MCP server running on Node.js for physics computations and tool orchestration
Uses pnpm for package management and dependency installation across the multi-package physics computation workspace
Leverages Python backend for scientific computations including CAS operations, plotting, quantum mechanics, and statistical mechanics
Provides optional GPU acceleration for physics computations with automatic CPU fallback
Generates SVG output for mathematical plots and visualizations including 2D functions, vector fields, and quantum mechanics diagrams
Powers computer algebra system operations for differentiation, integration, equation solving, and tensor calculus computations
Implements the main MCP server and tool adapters in TypeScript for physics computation orchestration
Physics MCP Server
Home · Docs · Architecture · Configuration · Tools: CAS · Plot · NLI · Report · Tensor · Quantum · StatMech
A specialized MCP (Model Context Protocol) server for physicists, providing Computer Algebra System (CAS), plotting, and natural language interface capabilities.
Features
Phase 1-3 (Current)
CAS tools: evaluate, differentiate, integrate, solve equations/ODEs with optional units
Plot tools: 2D functions, parametric curves, 2D vector fields, 3D surfaces, contours, phase portraits (PNG + CSV + SVG)
NLI tool: parse natural language into structured tool calls (LM Studio compatible)
Units & Constants: Pint-based unit conversion, CODATA and astrophysical constants
Report tool: generate Markdown reports from persisted sessions
Tensor algebra: Christoffel symbols, curvature tensors, geodesics
Quantum mechanics: operator algebra, standard problems (SHO, particle in box), Bloch sphere visualization
Statistical mechanics: partition functions, thermodynamic quantities
Device acceleration: Optional GPU acceleration via PyTorch with CPU fallback
Architecture
Quick Start
Prerequisites
Node.js 20+
Python 3.11+
pnpm 8+
Optional (recommended for faster NLI):
LM Studio or any OpenAI-compatible local LM server
Installation
Configuration
Environment variables used by NLI:
LM_BASE_URL
,LM_API_KEY
(optional),DEFAULT_MODEL
See
mcp_config.json
for a working example of server + env configurationAdd the server to your MCP client configuration
See docs/Configuration for details.
Optional: Faster NLI with LM Studio
LM Studio is not required. All CAS/plot/tensor/quantum/stat-mech calculations run in TypeScript/Python workers and work out of the box. Configuring a local LM endpoint such as LM Studio only accelerates the Natural Language Interface (NLI) that turns plain English into structured tool calls.
Why it helps
Lower latency: local inference avoids network round-trips and rate limits.
GPU utilization: LM Studio can use your GPU to speed up prompt parsing.
Better parsing on complex requests: higher-quality intent extraction reduces retries before calculations begin.
Privacy & cost: keep tokens local; no external API keys required.
How it speeds up “calculations” end-to-end
The math is computed by our Python/TS backends; the LM is used to decide “what to compute.” Faster parsing → fewer back-and-forths → quicker CAS/plot calls → faster overall results.
How to enable
Install and run LM Studio (or any OpenAI-compatible local server).
Set
LM_BASE_URL
(e.g.,http://localhost:1234/v1
) andDEFAULT_MODEL
.Optionally set
LM_API_KEY
if your local server requires it.
Example Usage
Development
Building
Linting & Formatting
Testing
Documentation
Docs index:
docs/README.md
Architecture:
docs/Architecture.md
Configuration:
docs/Configuration.md
Tools:
CAS:
docs/Tools/CAS.md
Plot:
docs/Tools/Plot.md
NLI:
docs/Tools/NLI.md
Report:
docs/Tools/Report.md
Tensor:
docs/Tools/Tensor.md
Quantum:
docs/Tools/Quantum.md
StatMech:
docs/Tools/StatMech.md
Examples:
examples/requests/
Side note: We conserve clarity and momentum—any dispersion is purely numerical.
Roadmap
Phase 2+: tensor calculus (sympy.diffgeom), quantum ops (qutip), 3D rendering, PDE/FEM, scientific data I/O, LaTeX/PDF reporting.
License
MIT License - see LICENSE file for details.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables physicists to perform computer algebra calculations, create scientific plots, solve differential equations, work with tensor algebra and quantum mechanics, and parse natural language physics problems. Supports unit conversion, physical constants, and generates comprehensive reports with optional GPU acceleration.