V-Sekai-fire's Sympy

行业场景

by V-Sekai-fire

Solve symbolic mathematics problems using SymPy.

什么是 V-Sekai-fire's Sympy

Solve symbolic mathematics problems using SymPy.

README

SymPy MCP

smithery badge

An Elixir-based MCP (Model Context Protocol) server that provides symbolic mathematics capabilities using SymPy.

Features

  • Symbolic Equation Solving: Solve algebraic equations for variables
  • Expression Simplification: Simplify complex symbolic expressions
  • Differentiation & Integration: Compute derivatives and integrals
  • Expression Manipulation: Expand and factor algebraic expressions
  • Numerical Evaluation: Evaluate expressions with variable substitutions

Quick Start

Prerequisites

  • Elixir 1.18+
  • OpenSSL development libraries

Note: Python 3.12 and SymPy are automatically installed during compilation.

Installation

bash
git clone https://github.com/V-Sekai-fire/sympy-mcp.git
cd sympy-mcp
mix deps.get
mix compile

Usage

STDIO Transport (Default)

For local development:

bash
mix mcp.server

Or using release:

bash
./_build/prod/rel/sympy_mcp/bin/sympy_mcp start

HTTP Transport

For web deployments (e.g., Smithery):

bash
PORT=8081 MIX_ENV=prod ./_build/prod/rel/sympy_mcp/bin/sympy_mcp start

Endpoints:

  • POST / - JSON-RPC 2.0 MCP requests
  • GET /sse - Server-Sent Events for streaming
  • GET /health - Health check

Docker

bash
docker build -t sympy-mcp .
docker run -d -p 8081:8081 --name sympy-mcp sympy-mcp

Available Tools

  • sympy_solve - Solve equations (e.g., x**2 - 1 for x)
  • sympy_simplify - Simplify expressions
  • sympy_differentiate - Compute derivatives
  • sympy_integrate - Compute integrals
  • sympy_expand - Expand expressions
  • sympy_factor - Factor expressions
  • sympy_evaluate - Evaluate numerically

Example

STDIO:

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "sympy_solve",
    "arguments": {
      "equation": "x**2 - 4",
      "variable": "x"
    }
  }
}

HTTP:

bash
curl -X POST http://localhost:8081/ \
  -H "Content-Type: application/json" \
  -H "mcp-protocol-version: 2025-06-18" \
  -d '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "sympy_solve", "arguments": {"equation": "x**2 - 4", "variable": "x"}}}'

Configuration

Optional MCP Configuration:

The server supports optional configuration during initialization:

  • timeout_ms (integer, optional): Maximum time in milliseconds allowed for SymPy operations. If not provided, no timeout is enforced. Must be between 100 and 300000. Prevents resource exhaustion and DoS attacks.
    • Example values: 5000, 10000, 30000

Environment Variables:

  • PORT - HTTP server port (default: 8081)
  • HOST - HTTP server host (default: 0.0.0.0 if PORT set, else localhost)
  • MIX_ENV - Environment (prod, dev, test)
  • ELIXIR_ERL_OPTIONS - Erlang options (set to "+fnu" for UTF-8)

The server uses HTTP streaming only (no stdio transport).

Troubleshooting

Python/SymPy not found: The build process installs Python 3.12 automatically. Run mix clean && mix compile if issues persist.

Port already in use: Change PORT environment variable or stop conflicting services.

Compilation errors: Run mix deps.get && mix clean && mix compile.

Debug mode: Use MIX_ENV=dev mix mcp.server for verbose logging.

License

MIT License - see LICENSE.md for details.

Contributing

See DEVELOPING.md for development setup and contribution guidelines.

常见问题

V-Sekai-fire's Sympy 是什么?

Solve symbolic mathematics problems using SymPy.

相关 Skills

面试体系设计

by alirezarezvani

Universal
热门

按岗位、级别和团队设计面试流程,生成能力矩阵、题库与评分标准,分析面试官偏差并校准招聘门槛,适合搭建或优化企业招聘体系。

团队招人没章法时,用它快速搭建岗位化面试流程、题库与评分标准,还能兼顾校准面试偏差,招聘更稳更准。

行业场景
未扫描10.7k
热门

当用户提到“观察列表”或“股票观察”时触发。用于管理钉钉多维表格中的股票观察名单。

行业场景
未扫描4.0k

UTXO工具

by BytesAgain

热门

Utxo reference tool. Use when working with utxo in blockchain contexts.

行业场景
未扫描4.0k

相关 MCP Server

by boosted-chat

热门

Flight search & booking for AI agents. 400+ airlines, $20-50 cheaper than OTAs.

行业场景
475

检索韩国市场公司的披露文件与财务报表,并获取股票概况等关键信息。

想研究韩股公司时,它能一站式拉取披露、财报和股票概况,省去跨站查资料的麻烦,对跨境投研尤其省时。

行业场景
114

Search company disclosures and financial statements from the Korean market. Retrieve stock profiles, market classifications, and historical trading data across major exchanges. Accelerate equity research with accurate, date-specific insights for Korean securities.

做韩国股研时,用它能一站查公司披露、财报和历史行情,按日期精确追溯关键信息,比手动翻交易所高效太多。

行业场景
114

评论