Token导航 LogoToken导航TokenDH.com
Godbolt MCP logo
AI代理stdio官方级别未说明来源级核验

Godbolt MCP

MCP Server

一个基于Model Context Protocol (MCP)的服务,提供对Godbolt Compiler Explorer REST API端点的访问,支持多种编程语言的编译和代码格式化功能。

工具数

3

提示词数

0

GitHub Stars

3

资源数

0
PythonAPI集成AI代理

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Benestar

提供方

Benestar

最后核验

2026/5/17 20:21

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python -m venv venv

详细介绍

Godbolt编译器浏览器MCP

A. 模型上下文协议(MCP) 提供访问权限的服务器 Godbolt编译器资源管理器 REST API端点。与 FastMCP Python库。

安装

  1. 克隆此存储库:
git clone 
cd godbolt-mcp
  1. 创建并激活虚拟环境:
python -m venv venv
source venv/bin/activate
  1. 安装依赖项:
pip install -r requirements.txt

用法

独立使用

直接运行MCP服务器:

python godbolt_mcp.py

添加到MCP兼容代理

将服务器添加到MCP配置中(使用虚拟环境Python):

{
  "mcpServers": {
    "godbolt-compiler-explorer": {
      "command": "/absolute/path/to/godbolt-mcp/venv/bin/python",
      "args": ["/absolute/path/to/godbolt-mcp/godbolt_mcp.py"]
    }
  }
}

备注:替换 /absolute/path/to/godbolt-mcp 使用安装目录的实际绝对路径。

可用工具

资源(只读访问)

  • resource://languages -列出所有支持的编程语言
  • resource://compilers/{language_id} -获取特定语言的可用编译器
  • resource://libraries/{language_id} -获取特定语言的可用库
  • resource://formats -列出可用的代码格式化程序
  • resource://asm/{instruction_set}/{opcode} -获取装配说明文档
  • resource://version -获取编译器资源管理器版本信息

工具(动作)

  • compile_code(compiler_id, source, user_arguments=None, files=None, libraries=None) -编译源代码
  • compile_cmake(compiler_id, source, user_arguments=None, files=None, libraries=None) -编译CMake项目
  • format_code(formatter, source) -格式化源代码

例子

examples/ 文件夹包含可用于测试MCP服务器的示例源文件:

  • hello.cpp -简单的C++“Hello World”程序
  • hello.rs -简单的Rust“Hello World”程序

使用MCP兼容代理尝试以下提示,为示例文件生成汇编代码:

以C++为例:

Compile the hello.cpp file from the examples folder with GCC and show me the exact generated assembly code with optimization level -O2.

以Rust为例:

Compile the hello.rs file from the examples folder with the latest Rust compiler and show me the exact generated assembly code with release optimizations.

依赖项

  • fastmcp>=0.2.0 -MCP服务器框架
  • httpx>=0.25.0 -API请求的HTTP客户端

目录标签

目录标签

PythonAPI集成AI代理编译器本地部署代码格式化编程语言RESTAPIMCP协议

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

3

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP