Expr-Lang MCP server

Provides a powerful expression evaluation engine for complex data manipulations, enabling mathematical operations, array transformations, string processing, and conditional logic directly within conversations.
Back to servers
Setup instructions
Provider
Ivan Saorin
Release date
May 01, 2025
Language
Python
Stats
1 star

MCP Expr-Lang is a powerful expression evaluation tool that integrates with Claude Desktop using the Model Context Protocol (MCP). It allows you to perform complex data manipulations, calculations, and transformations directly within your Claude conversations using the expr-lang expression evaluation engine.

Installation Options

Quick Installation via Smithery

To install MCP Expr-Lang for Claude Desktop automatically:

npx -y @smithery/cli install @ivan-saorin/mcp-expr-lang --client claude

Manual Installation

Prerequisites

  • Go 1.18 or higher
  • Claude Desktop application
  • Git

Step 1: Clone the Repository

git clone https://github.com/ivan-saorin/mcp-expr-lang.git
cd mcp-expr-lang

Step 2: Install Dependencies

go mod download

Step 3: Build the Application

For Windows:

go build -o bin/server.exe

For macOS/Linux:

go build -o bin/server
chmod +x bin/server

Step 4: Configure Claude Desktop

  1. Open Claude Desktop
  2. Go to Settings
  3. Navigate to the "Advanced" section
  4. Add the following configuration to your config.json:

For Windows:

{
  "mcpServers": {
    "eval": {
      "command": "C:\\path\\to\\mcp-expr-lang\\bin\\server.exe"
    }
  }
}

For macOS/Linux:

{
  "mcpServers": {
    "eval": {
      "command": "/path/to/mcp-expr-lang/bin/server"
    }
  }
}
  1. Save the configuration and restart Claude Desktop

Usage

Once installed, you can use the eval tool directly in your conversations with Claude by asking Claude to evaluate expressions.

Basic Example

User: Use eval to calculate "10 + 5 * 3"

Claude: [Uses eval tool] Result: 10 + 5 * 3 = 25

Complex Example

User: We have users = [{"Name": "John", "Age": 30},{"Name": "Ivan", "Age": 51},{"Name": "Eve", "Age": 15}] Use eval to calculate "sortBy(users, .Age, "desc")"

Claude: [Uses eval tool] Result: The expression returns the users sorted by age in descending order:

[
  {"Age": 51, "Name": "Ivan"},
  {"Age": 30, "Name": "John"},
  {"Age": 15, "Name": "Eve"}
]

Features

MCP Expr-Lang supports all features of the expr-lang engine, including:

  • Arithmetic operations: Addition, subtraction, multiplication, division, modulo, exponentiation
  • String operations: Concatenation, length, uppercase/lowercase conversion
  • Boolean operations: AND, OR, NOT, comparison operators
  • Array operations: Mapping, filtering, reducing, sorting
  • Object manipulation: Property access, transformation
  • Conditional logic: Ternary operators, if-else expressions
  • Built-in functions: Mathematical, string, array, and date functions

For a complete guide to the expression language syntax and capabilities, see the expr-lang documentation.

Troubleshooting

Common Issues

  • Tool not appearing in Claude: Make sure the path in your config.json is correct and Claude Desktop has been restarted.
  • Execution errors: Check that the expression syntax is correct according to the expr-lang documentation.
  • Permission issues (macOS/Linux): Ensure the server binary has execution permissions (chmod +x bin/server).

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "eval" '{"command":"npx","args":["-y","@ivan-saorin/mcp-expr-lang"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "eval": {
            "command": "npx",
            "args": [
                "-y",
                "@ivan-saorin/mcp-expr-lang"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "eval": {
            "command": "npx",
            "args": [
                "-y",
                "@ivan-saorin/mcp-expr-lang"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later