
Mcp Bruno
io.github.kta41由 GitHub 帳號 kta41 發布v0.1.1更新於 Oct 24, 2026
Python MCP server for running and inspecting Bruno API collections.
概覽
本機 MCP 伺服器,讓助理透過 Bruno CLI 執行與檢視 Bruno API 集合,並回傳正規化的 JSON 結果。
- 可以做什麼
- 在設定的根目錄下列出與探索 Bruno 集合,可依名稱或路徑篩選
- 執行集合或單一請求檔,指定環境與變數,回傳成功狀態、摘要、失敗項目與耗時
- 探索同層的 environment 檔案及其變數名稱,但不回傳密鑰值
- 檢視已記錄的查詢篩選器,並在不修改原始檔案的情況下執行臨時篩選情境
- 執行兩階段完整驗證:先做基準端點檢查,再逐一測試被停用的查詢篩選器
- 讀取已保存原始執行產物中的受限、去識別化摘要
- 適用情境
- 當 API 測試以 Bruno 集合維護,並希望助理在對話或 IDE 代理中執行這些測試、檢查端點或驗證查詢篩選器時適用。它著重於本機開發與 HTTP API 驗證,而非一般網頁瀏覽。
- 執行需求
- 以本機 stdio 程序在使用者電腦上執行(僅桌面端)。需要 Python 3.10 以上與 uv,以及透過 npm 安裝的 Bruno CLI(bru),除非明確開啟自動安裝。選用設定位於 bruno-mcp.toml 或 ~/.config/bruno-mcp/config.toml;密鑰可透過 BRUNO_AUTH_TOKEN 環境變數或本機權杖檔提供。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Mcp Bruno,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
🔌 Bruno MCP Server for Python
Python MCP server for running Bruno collections. It exposes a Model Context Protocol server over
stdiowith tools that run collections through thebruCLI and return normalized JSON results.
Note: All examples in this repository use placeholder names (project1, /home/user/project/bruno, example.test). Replace them with your own paths and collection names.
✨ Features
- Run Bruno collections natively using the Bruno CLI.
- Discover collections and sibling environment files automatically.
- Support environment files and dynamic environment variables.
- Secure Secret Injection: Pass secrets to Bruno without exposing values to the LLM via
inherited_variables. Secret values are injected through a temporary, owner-only--env-fileand the child process environment — they never appear in CLI arguments (psoutput) or logs. - Filter Inspection: Inspect documented query filters and run temporary filter scenarios without modifying the source collection.
- Two-Phase Full Validation: Execute baseline tests + all documented filters in a single tool call.
- Normalized Outputs: Return structured execution results containing
success,summary,failures, andtimings.
📦 Requirements
- Python: 3.10 or newer
- Package Manager:
uv - Node Package Manager:
npm(only if the Bruno CLI is not already installed)
The installer checks whether the Bruno CLI command bru is available. If it is missing, the server fails with an explicit error instead of silently installing packages. To install the pinned version manually:
Runtime auto-install is available but opt-in: set BRUNO_MCP_AUTO_INSTALL_BRU=1 (or auto_install = true under [bruno] in the config file) and the server installs exactly the pinned version from cli_version / BRUNO_MCP_BRU_VERSION.
🚀 Installation & Running
1. Installation
Install dependencies using uv:
(If your configured package index does not mirror the MCP Python SDK, point uv at PyPI for the sync: UV_DEFAULT_INDEX=https://pypi.org/simple uv sync)
2. Running the Server
You can run the server directly using uv:
Alternatively, run the module directly inside the uv environment: uv run python -m bruno_mcp
⚙️ Configuration
MCP Configuration
Example MCP stdio configuration from this workspace root:
Configuration File (bruno-mcp.toml)
Default roots and auth aliases can be configured in bruno-mcp.toml in the current working directory, or globally in ~/.config/bruno-mcp/config.toml.
See bruno-mcp.example.toml for a commented template:
Every setting can also be set via environment variables (BRUNO_MCP_BRU_VERSION, BRUNO_MCP_AUTO_INSTALL_BRU, BRUNO_MCP_RUN_TIMEOUT, BRUNO_MCP_MAX_OUTPUT_BYTES, BRUNO_MCP_MAX_CONCURRENT_RUNS, BRUNO_MCP_ARTIFACTS_DIR, BRUNO_MCP_ARTIFACT_TTL_HOURS, BRUNO_MCP_ARTIFACT_MAX_FILES, BRUNO_MCP_ENFORCE_ROOT_CONFINEMENT, BRUNO_MCP_LOG_LEVEL), which take precedence over the file.
Note: The installer creates
~/.config/bruno-mcp/config.tomlwith a dummy root. Localbruno-mcp.tomlfiles are git-ignored so real paths and environment names are never committed.
💻 Local VS Code Installation
From the project root, install dependencies with uv:
Ensure the Bruno CLI is available (bru --version). This repository includes .vscode/mcp.json, allowing VS Code to discover the local MCP server from the workspace:
Reload the VS Code window after syncing dependencies. The bruno-runner server should now be available in the MCP servers list.
Global Installation
To install the MCP server in the VS Code user profile so it is available from any workspace:
(To also install the reusable Copilot prompt and agent globally, append --with-copilot-customizations to the command above).
To install it manually in another local VS Code workspace, change the command args to include --directory:
🧰 Available Tools
🔍 list-collections
Lists Bruno collections below a root directory or configured roots. Use it when the user provides a partial collection name instead of a full path.
root(optional): Bruno root directory (usually containscollections/andenvironments/).query(optional): Case-insensitive text used to filter collection names and paths.
▶️ run-collection
Runs a Bruno collection and returns normalized execution results.
collection(required): Path to the Bruno collection.environment(optional): Path to an environment file.variables(optional): Environment variables asKEY=valuestrings.inherited_variables(optional): Names of environment variables to read from the MCP server process and inject into Bruno without exposing values to the LLM. Values travel via a temporary owner-only--env-fileand the child process environment ({{process.env.NAME}}also works) — never in CLI arguments.
View detailed authentication & path behavior
Auth Handling:
For secrets, prefer inherited_variables instead of writing values in chat. By default, the secure MCP input BRUNO_AUTH_TOKEN can satisfy Bruno variables named bearerToken, BEARER_TOKEN, AUTH_TOKEN, TOKEN, accessToken, or access_token. Secrets are injected via a temporary private --env-file; if the selected --env environment file declares the same variable (which would take precedence inside bru), the run transparently switches to a temporary sanitized copy of the collection with the conflicting entry removed, so the injected secret always wins and source files are never modified.
Workspace confinement:
When [workspace] roots are configured (and at least one exists on disk), collection paths outside those roots are rejected with a clear error. Set enforce_root_confinement = false to disable.
Execution limits:
Each bru run has a configurable timeout (run_timeout_seconds, default 300s), bounded stdout/stderr capture (max_output_bytes), and a concurrency cap (max_concurrent_runs). Raw JSON reports are stored as artifacts with owner-only (0600) permissions and expire automatically (ttl_hours / max_files). Structured logs go to stderr (BRUNO_MCP_LOG_LEVEL).
Supported Collection Inputs:
- Collection directory:
/path/to/bruno/collections/project1 - Bruno request file:
/path/to/bruno/collections/project1/request.bru - Internal
.vrurequest file:/path/to/bruno/collections/project1/request.vru - Open collection descriptor:
/path/to/bruno/collections/project1/opencollection.yml
When Bruno failures look like authentication problems, the response includes auth_failure: true and an auth_message.
Example with inherited secrets:
🌍 discover-environments
Inspects the folder structure around a Bruno collection and returns the sibling environments directory, available environment names, and variable names (without returning secret values).
📖 read-result-artifact
Reads a bounded, redacted summary from the raw Bruno JSON artifact path returned by run-collection.
path(required): Theartifact.pathvalue returned by a previous run.max_items(optional): Number of response items to sample per request (default 3, max 20).
🧪 list-request-filters & run-filter-scenarios
list-request-filters: Inspects YAML request files and returns query params split into enabled and disabled groups.run-filter-scenarios: Runs temporary request variants with selected disabled query params enabled without modifying the source files.
🛡️ run-full-validation
Two-phase orchestration in a single tool call:
- Baseline: Runs the collection once and checks every endpoint responds without errors (no
4xx/5xx). - Filters: Only runs if the baseline is green. Automatically discovers and tests every disabled query filter across every endpoint.
Agent Skills & Copilot Integration
These workflows use the MCP server configured as bruno-runner; installing a skill or prompt does not install or configure the server. Configure the server in your client first using the MCP configuration above.
VS Code GitHub Copilot
The repository includes a custom agent and a slash-command prompt. From this repository root, copy them into the target workspace:
Select the bruno-runner custom agent in Copilot Chat's agent picker (@bruno-runner where supported), or run /run-bruno-collection <collection or path> [environment] in Chat. The slash command works independently of selecting the custom agent.
Alternatively, install both globally with:
Claude Code / Cursor / Windsurf
The universal Bruno Runner skill consolidates collection discovery, environment selection, standard runs, targeted filter scenarios, full two-phase validation, secret safety, and reporting rules.
For Claude Code, copy it into the target project's skill directory:
Or symlink the skill directory using an absolute source path:
For Cursor, copy or symlink the same directory to .cursor/skills/bruno-runner/; for Windsurf, use .windsurf/skills/bruno-runner/ in the target workspace. Skill discovery depends on your client's version and configuration. For clients using rules instead, adapt the skill body into their native rule format (for example, a .cursor/rules/bruno-runner.mdc file with Cursor rule frontmatter); merely copying SKILL.md into a rules directory does not guarantee activation.
Ask to run a collection, validate a specific filter, or test all endpoints and filters. The workflows resolve secrets locally through inherited_variables; never paste credentials into chat. The server's local token fallback is ~/.config/bruno-mcp/.bearer_token (raw token), not ~/.config/mcp-bruno/.bearer_token. After updating it, restart the MCP server.
Repository Assets
Skills and Copilot templates remain organized under skills/ and copilot/ at the repository root, separately from the Python packages discovered under src/ in pyproject.toml. They are repository assets, not installed wheel resources; use a repository checkout for the copy, symlink, and installer commands above. Installing the Python package alone does not register agent workflows with a client.
Execution results retain the server's normalized output contract:
🐳 Docker
The Docker image installs both this Python server and the Bruno CLI:
🛠️ Development & Project Structure
Commands:
- Compile-check the sources:
uv run python -m compileall src - Run the test suite:
uv run python -m unittest discover -s tests -v
Structure:
mcp-name: io.github.kta41/mcp-bruno
📄 License
Released under the MIT License.
來源:README.md,提交 d3f31b1
工具
0版本歷史
1- v0.1.1最新Sep 30, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分