Skip to main content
Glama

gauss-mcp

Licence Python Platform GAUSS

从Python驱动GAUSS,并通过模型上下文协议将其暴露给LLM客户端。

作者:Dr Merwan Roudane

在Windows上针对GAUSS 26.1.1构建并测试。

为什么存在这个项目

Aptech发布了一份AI助手参考,以便它们编写更好的GAUSS代码,但编写不等于运行:无法执行代码的助手永远不知道代码是否有效,也不知道数字是多少。本项目将助手连接到真实的GAUSS安装,因此结果来自GAUSS而非模型。

Related MCP server: julia-mcp

它如何驱动GAUSS

通过tgauss,即普通GAUSS安装附带的终端构建——而不是GAUSS引擎,后者功能更丰富,但需要向Aptech单独申请许可证密钥。

每次调用都是独立的tgauss进程,因此通常不会有任何状态延续。工作区在退出时保存,在进入时恢复,这使得一系列调用表现得像一个连续的会话:在一次调用中构建的矩阵在下一次调用中仍然存在。

安装

PyPI上的发行包名为**gauss-lang-mcp**:普通的gauss-mcp已被一个与导入工作流相关的无关包占用,与Aptech语言无关。导入名称仍然是gauss_mcp

pip install "gauss-lang-mcp[pandas]"

GAUSS会在C:\gauss*C:\Program Files\gauss*下自动查找。设置GAUSS_HOME可以在多个安装之间选择。

库使用

from gauss_mcp import Gauss

with Gauss() as g:
    g.run("""
        rndseed 90210;
        n = 400;
        x = rndn(n, 1);
        y = 1.25 + 0.8*x + 0.3*rndn(n, 1);
        des = ones(n,1)~x;
        bhat = invpd(des'des)*des'y;
    """)
    print(g.get_matrix("bhat"))     # [[1.2489...], [0.8043...]]

值以CSV而非打印文本的形式传递,因此它们保持完整的双精度,而不是GAUSS的显示舍入:

g.run("pi_like = 3.14159265358979;")
g.get_scalar("pi_like")          # 3.14159265358979, every digit

pandas双向传递:

frame = g.to_dataframe(["x", "y"])
g.from_dataframe(frame)

MCP服务器使用

{
  "mcpServers": {
    "gauss": { "command": "gauss-lang-mcp" }
  }
}

工具

工具

用途

gauss_status

GAUSS的位置、版本以及工作区包含的内容

run_gauss_code

主要工具。 运行GAUSS代码并返回其打印的内容

list_symbols

每个符号及其类型和维度

describe_symbol

单个符号的类型和形状

get_matrix

以全精度读取矩阵

put_matrix

根据对话中给出的数字创建矩阵

read_csv / write_csv

在文件和工作区之间移动数据

clear_workspace

从空状态重新开始

错误

GAUSS报告自己的代码、消息和行号,这些都会被传递:

GaussError: G0025: Undefined symbol: 'no_such_thing' on line 2

行号指的是你的代码。工作区恢复会被前置到每个生成的程序,这会改变GAUSS自身的行号偏移;在显示之前会修正该偏移。

值得了解的行为

GAUSS和tgauss的特性,本包为你处理,每项都经过真实安装验证,而非假设。

  • 退出代码始终为0,无论程序成功还是失败。它不携带任何信息,因此错误从stderr读取。

  • stdout是干净的。 横幅和作业标题进入stderr,因此程序的输出无需过滤。

  • GAUSS先编译再运行。 任何未定义的符号都意味着没有执行任何操作,也没有输出。运行时错误会保留到该点为止的输出,然后显示“Program execute failed”。

  • 符号名称忽略大小写。 Xx是同一个符号,因此赋值给一个会覆盖另一个。这会让从R或Python来的人感到惊讶。

  • 子进程不能继承stdin。 在MCP下,服务器的stdin是JSON-RPC流;继承它的tgauss会读取协议本身。每次子进程调用都会分离stdin。

  • 恢复工作区使用use,而不是loadall saveall写入.gcg文件,而use <name>;必须是读取该文件的程序的第一条语句。

测试

python tests/test_offline.py   # 10 tests, no GAUSS needed
python tests/test_live.py      # 24 tests, drives a real installation

许可证

MIT。版权所有(c)2026 Merwan Roudane。

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    Enables AI assistants to execute Julia code efficiently with persistent sessions, avoiding startup costs and maintaining state across calls.
    3
    83
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Enables AI agents to interact with the Baltamatica scientific computing kernel, executing code, managing variables, and running scripts while preserving workspace state across calls.
    6
    4
    MIT
  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables ISLI agents and MCP clients to dispatch natural-language coding and terminal tasks to a locally-installed Claude Code CLI, supporting both one-shot execution and persistent sessions with workspace and security controls.

View all related MCP servers

Related MCP Connectors

  • Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.

  • Securely search and manage workspace context files for AI agents and teams.

  • Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/merwanroudane/mcp_gauss'

If you have feedback or need assistance with the MCP directory API, please join our Discord server