MCP Expr Lang

MIT License
  • Linux
  • Apple

Integrations

  • Used for cloning the repository during installation process.

  • Referenced for issue tracking and contributions to the MCP server project.

  • Supported as a deployment platform for running the MCP server.

MCP Expr-Lang

使用模型上下文协议 (MCP) 的 Claude Desktop 的强大表达式评估工具。

概述

MCP Expr-Lang 实现了 Claude AI 与强大的expr-lang表达式求值引擎的无缝集成。此工具允许您直接在 Claude 对话中执行复杂的数据操作、计算和转换。

使用 MCP Expr-Lang,您可以:

  • 计算数学表达式
  • 转换和过滤数组和对象
  • 对复杂数据结构进行排序
  • 执行字符串操作
  • 使用条件逻辑
  • 还有更多!

安装

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 MCP Expr-Lang:

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

先决条件

  • Go 1.18 或更高版本
  • Claude桌面应用程序
  • Git

步骤 1:克隆存储库

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

第 2 步:安装依赖项

go mod download

步骤 3:构建应用程序

对于 Windows
go build -o bin/server.exe
对于 macOS/Linux
go build -o bin/server chmod +x bin/server

步骤4:配置Claude桌面

  1. 打开 Claude 桌面
  2. 前往“设置”
  3. 导航至“高级”部分
  4. 将以下配置添加到您的config.json
对于 Windows
{ "mcpServers": { "eval": { "command": "C:\\path\\to\\mcp-expr-lang\\bin\\server.exe" } } }
对于 macOS/Linux
{ "mcpServers": { "eval": { "command": "/path/to/mcp-expr-lang/bin/server" } } }
  1. 保存配置并重新启动Claude Desktop

用法

安装完成后,您可以直接在与 Claude 的对话中使用eval工具。只需让 Claude 使用该工具计算表达式的值即可。

基本示例

User: Use eval to calculate "10 + 5 * 3" Claude: [Uses eval tool] Result: 10 + 5 * 3 = 25

复杂示例

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"} ]

更多示例请参见示例

特征

MCP Expr-Lang 支持 expr-lang 引擎的所有功能,包括:

  • 算术运算:加法、减法、乘法、除法、模数、指数运算
  • 字符串操作:连接、长度、大小写转换
  • 布尔运算:AND、OR、NOT、比较运算符
  • 数组操作:映射、过滤、缩减、排序
  • 对象操作:属性访问、转换
  • 条件逻辑:三元运算符、if-else 表达式
  • 内置函数:数学、字符串、数组和日期函数

有关表达式语言语法和功能的完整指南,请参阅expr-lang 文档

故障排除

常见问题

  1. 工具未出现在 Claude 中:请确保config.json中的路径正确并且 Claude Desktop 已重新启动。
  2. 执行错误:根据 expr-lang 文档检查表达式语法是否正确。
  3. 权限问题(macOS/Linux) :确保服务器二进制文件具有执行权限( chmod +x bin/server )。

获取帮助

如果您遇到任何问题或有疑问:

  1. 查看 GitHub 上的问题部分
  2. 如果您的问题尚未被报告,请提出一个新问题

贡献

欢迎贡献!如果您想改进 MCP Expr-Lang:

  1. 分叉存储库
  2. 创建功能分支( git checkout -b feature/amazing-feature
  3. 提交您的更改( git commit -m 'Add some amazing feature'
  4. 推送到分支( git push origin feature/amazing-feature
  5. 打开拉取请求

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

致谢


Ivan Saorin用❤️制作

-
security - not tested
A
license - permissive license
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

MCP 表达式语言

  1. Overview
    1. Installation
      1. Installing via Smithery
      2. Prerequisites
      3. Step 1: Clone the Repository
      4. Step 2: Install Dependencies
      5. Step 3: Build the Application
      6. Step 4: Configure Claude Desktop
    2. Usage
      1. Basic Example
      2. Complex Example
    3. Features
      1. Troubleshooting
        1. Common Issues
        2. Getting Help
      2. Contributing
        1. License
          1. Acknowledgments

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              gitlab mcp
              Last updated -
              13
              983
              75
              JavaScript
              MIT License
              • Linux
              • Apple
            • A
              security
              A
              license
              A
              quality
              mcp-hydrolix
              Last updated -
              3
              1
              Python
              Apache 2.0
              • Apple
            • A
              security
              A
              license
              A
              quality
              interactive-mcp
              Last updated -
              5
              705
              29
              TypeScript
              MIT License
              • Apple
              • Linux

            View all related MCP servers

            ID: sg086i9cin