Provides integration with Bruno CLI for API testing and collection management, including running individual requests or entire collections, managing environments, generating test reports in multiple formats (JSON, JUnit, HTML), validating collections, and introspecting request configurations.
Bruno MCP Server
An MCP (Model Context Protocol) server that provides integration with Bruno CLI for API testing and collection management.
🚀 Quick Start
Install via NPM (Recommended)
Install from Source
Features
Core Features
✅ Run individual API requests from Bruno collections
✅ Run entire collections or specific folders
✅ List all requests in a collection
✅ Environment variable support and validation
✅ Report generation (JSON, JUnit, HTML)
✅ Collection discovery and validation
✅ Request introspection and dry run mode
✅ Health monitoring and performance metrics
✅ Security features (path validation, secret masking)
✅ Caching for optimal performance
✅ Mock CLI mode for testing and CI/CD
Installation
Prerequisites
Node.js: Version 20 or higher
Bruno Collections: Your existing Bruno API test collections
Option 1: NPM Global Installation
This installs the server globally and makes it available as a command.
Option 2: NPM Local Installation
Add to your MCP client config using node_modules/.bin/bruno-mcp-server.
Option 3: From Source
Clone the repository:
git clone https://github.com/jcr82/bruno-mcp-server.git cd bruno-mcp-server npm install npm run buildThe built server will be in
dist/index.js.
Configuration
For Claude Desktop
Add the following to your Claude Desktop configuration file:
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
If installed globally via npm:
If installed from source:
If installed locally in a project:
Usage
Once configured, you can use the following tools through your MCP client:
1. Run a Specific Request
Dry Run Mode:
Set dryRun: true to validate request configuration without executing the HTTP call:
Output:
2. Run a Collection
Dry Run Mode for Collections:
Output:
3. List Requests
4. Discover Collections
Recursively search for Bruno collections in a directory:
Example output:
5. List Environments
List all environments available in a collection:
Example output:
6. Validate Environment
Validate an environment file's structure and variables:
Example output:
7. Get Request Details
Inspect a request's configuration without executing it:
Example output:
Use Cases:
Inspect request configuration before execution
Debug request setup issues
Generate documentation from requests
Understand test assertions
Review request structure
8. Validate Collection
Validate a Bruno collection's structure, syntax, and integrity:
Example output:
Use Cases:
Pre-flight validation before deployment
CI/CD pipeline checks
Catch configuration errors early
Verify collection integrity
Validate after collection updates
9. Health Check
Check the server health, Bruno CLI availability, and optionally view performance metrics and cache statistics:
Example output:
Report Generation
The Bruno MCP Server supports generating test reports in three formats:
JSON Report
Contains detailed test results in JSON format, ideal for programmatic processing.
JUnit XML Report
Compatible with CI/CD systems like Jenkins, GitHub Actions, and GitLab CI. Perfect for integration into automated pipelines.
HTML Report
Beautiful, interactive HTML report with Vue.js interface for easy viewing in browsers.
Example: Generate All Reports
The server will confirm when reports are generated:
Example Collection
A ready-to-use example collection is available in collection-examples/getting-started. This collection demonstrates:
Basic HTTP methods (GET, POST, PUT)
Environment variables usage
Request headers and bodies
Response tests and assertions
Report generation
The example uses the free JSONPlaceholder API, so you can run it immediately without any setup.
Quick Start:
See the example collection README for more details and usage examples.
Development
Run in Development Mode
Run Tests
Build
Configuration
The Bruno MCP Server supports configuration via a bruno-mcp.config.json file. The server looks for this file in the following locations (in order):
Environment variable:
BRUNO_MCP_CONFIGCurrent working directory:
./bruno-mcp.config.jsonHome directory:
~/.bruno-mcp.config.json
Configuration Options
Configuration Details
brunoCliPath: Custom path to Bruno CLI executable (default: auto-detect)
brunoHome: Bruno home directory for environments and settings
timeout.request: Timeout for individual requests in milliseconds (default: 30000)
timeout.collection: Timeout for collection runs in milliseconds (default: 120000)
retry.enabled: Enable automatic retry on failures (default: false)
retry.maxAttempts: Maximum retry attempts (1-10, default: 3)
retry.backoff: Retry backoff strategy: 'linear' or 'exponential'
security.allowedPaths: Restrict file system access to specific paths
security.maskSecrets: Enable secret masking in logs and errors (default: true)
security.secretPatterns: Additional regex patterns for secret detection
logging.level: Log level: 'debug', 'info', 'warning', 'error' (default: 'info')
logging.format: Log format: 'json' or 'text' (default: 'text')
performance.cacheEnabled: Enable request list caching (default: true)
performance.cacheTTL: Cache time-to-live in milliseconds (default: 300000)
See bruno-mcp.config.example.json for a complete example.
Security Features
Path Validation
The server validates all file paths to prevent directory traversal attacks. Configure security.allowedPaths to restrict access to specific directories.
Input Sanitization
All user inputs are sanitized to prevent command injection and other security vulnerabilities.
Secret Masking
Sensitive data (API keys, passwords, tokens) are automatically masked in logs and error messages. Customize detection patterns via security.secretPatterns.
Environment Variable Validation
Environment variables are validated for safe characters and patterns before being passed to Bruno CLI.
Performance Features
Request List Caching
Collection request lists are cached in memory with configurable TTL to reduce file system operations. Cache hits are logged for monitoring.
Execution Metrics
The server tracks performance metrics including:
Execution duration per tool
Success/failure rates
Average response times
Total executions
Access these metrics via the bruno_health_check tool with includeMetrics: true.
Project Structure
Error Handling
The server properly handles and reports:
Missing Bruno CLI installation
Invalid collection paths
Unsupported Bruno CLI operations
Request execution failures
Malformed input parameters
Documentation
📚 Guides
Getting Started - Step-by-step guide to install and configure Bruno MCP Server
Configuration - Complete configuration reference and options
Usage Patterns - Common workflows and best practices
Troubleshooting - Solutions to common issues
CI/CD Integration - Integrate with GitHub Actions, GitLab CI, CircleCI
Mock Mode - Testing without Bruno CLI dependencies
🔧 API Reference
MCP Tools API - Complete reference for all 9 MCP tools with examples
Troubleshooting
For detailed troubleshooting, see the Troubleshooting Guide.
Quick Fixes
Bruno CLI Not Found:
Ensure dependencies are installed:
npm installVerify Bruno CLI was installed:
npx bru --versionThe server will automatically use the local installation in
node_modules/.bin/bru
Collection Not Found:
Use absolute paths (not relative paths)
Verify the collection path is correct
Ensure the directory contains a
bruno.jsonfile
Permission Issues:
Ensure the MCP server has read access to your Bruno collections
Check that the server can execute the Bruno CLI
Next Steps
See ROADMAP.md for the complete feature roadmap.
Completed features:
✅ Core MCP server with Bruno CLI integration
✅ Run requests and collections
✅ Environment support
✅ Report generation (JSON, JUnit, HTML formats)
✅ Collection discovery (recursive search)
✅ Environment management (list, validate)
✅ Request introspection (inspect without executing)
✅ Dry run mode (validate without HTTP execution)
✅ Collection validation (structure, syntax, integrity checks)
✅ Configuration system with multi-location support
✅ Security hardening (path validation, input sanitization, secret masking)
✅ Performance optimizations (request list caching, execution metrics)
✅ Health check tool
Planned enhancements:
Logging system with structured output
Parallel execution support
Advanced filtering and search capabilities
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
License
MIT
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
Integrates Bruno CLI for API testing, enabling users to run API requests and collections, manage environments, generate test reports (JSON/JUnit/HTML), and validate collection structures through natural language commands.