Octoperf MCP
A Model Context Protocol (MCP) server for OctoPerf to launch and manage performance tests
Installation
npx octoperf-mcpAsk AI about Octoperf MCP
Powered by Claude Β· Grounded in docs
I know everything about Octoperf MCP. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
MCP OctoPerf
A Model Context Protocol (MCP) server for OctoPerf to launch and manage performance tests via AI assistants like Claude. ( Proof of Concept )
ποΈ Architecture
This project implements an MCP server that bridges AI assistants and the OctoPerf API:
ββββββββββββββββββββ MCP Protocol ββββββββββββββββββββ HTTP API βββββββββββββββββββ
β AI/Claude/[...] βββββββββββββββββββββΊβ MCP Server ββββββββββββββββββΊβ OctoPerf API β
β β JSON-RPC β (this project) β REST calls β β
ββββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
Project structure
/workspaces/mvp-mcp-octoperf/
βββ main.go # Entry point + MCP tools declaration
βββ handler.go # MCP handlers (interface layer)
βββ octoperf/
β βββ adapter.go # HTTP client for OctoPerf API
β βββ dto.go # Data structures
βββ .vscode/
β βββ mcp.json # MCP configuration (ready to use)
βββ .devcontainer/ # Dev Container configuration
βββ go.mod # Go dependencies
βοΈ Configuration
MCP Configuration with mcp.json (Recommended Method)
The MCP server uses a configuration file mcp.json located in the .vscode directory. This file contains connection information and necessary environment variables.
Configuration Steps:
-
Create the .vscode directory (if not already present):
mkdir -p .vscode -
Create the mcp.json file:
Create a
.vscode/mcp.jsonconfiguration file in your project. -
Understanding the mcp.json structure:
The
.vscode/mcp.jsonfile uses VS Code's input prompt system:{ "inputs": [ { "type": "promptString", "id": "octoperf-api-key", "description": "OctoPerf API Key", "password": true } ], "servers": { "octoperf": { "command": "go", "args": [ "run", "." ], "type": "stdio", "env": { "OCTOPERF_API_KEY": "${input:octoperf-api-key}" } } } } -
How the API Key Prompt Works:
- First startup: VS Code will automatically prompt you to enter your OctoPerf API Key
- Secure storage: The API key is stored locally as a password in VS Code's secure storage
- Subsequent startups: The stored key is automatically retrieved, no prompt needed
- Security: The API key is never stored in plain text in configuration files
-
Get your OctoPerf API Key:
- Log into your OctoPerf account
- Go to your profile settings
- Copy or generate your API key
- Copy the API key (you'll paste it when prompted by VS Code)
-
No build required: The MCP server runs directly with
go run .- no compilation step needed.
Required environment variables
OCTOPERF_API_KEY: API key for OctoPerf authentication (required) - automatically prompted and stored securely
Alternative configuration methods
-
System environment variables
export OCTOPERF_API_KEY=your_api_key_here -
Direct VS Code configuration
- The
mcp.jsonfile is automatically detected by VS Code - Environment variables are injected automatically
- API key prompting provides enhanced security
- The
π Installation and development
Prerequisites
- Docker (required for Dev Container)
- Go 1.23 or higher
- Valid OctoPerf API key
- VS Code or other IDE
Local installation
# Clone the repository
git clone [REPO_URL]
cd octoperf-mcp
# Install dependencies
go mod download
You can start the OctoPerf MCP Server through your IDE.
Development with Dev Container
# Open in VS Code with Dev Containers
code .
# VS Code will suggest opening in a Dev Container
# Create the .vscode/mcp.json configuration file as described above
π οΈ Available MCP Tools
The server exposes 7 tools to interact with OctoPerf:
π Resource Discovery
| Tool | Description | Parameters |
|---|---|---|
octoperf_get_current_user_workspaces | List all accessible workspaces | None |
get_project_by_workspace_id | List projects in a workspace | workspaceId (required) |
get_runtime_id | Retrieve runtime IDs for a project | projectId (optional) |
π Test Execution
| Tool | Description | Parameters |
|---|---|---|
octoperf_run_test | Start a performance test | runtimeId (required) |
octoperf_status | Check test status | benchResultId (required) |
π Results Analysis
| Tool | Description | Parameters |
|---|---|---|
octoperf_report | Retrieve report details | reportId (required) |
octoperf_get_report_metrics | Retrieve specific metrics | benchResultId (required), metricIds[] (required) |
Available metrics
The following metrics can be retrieved with octoperf_get_report_metrics:
- Performance:
RESPONSE_TIME_AVG,RESPONSE_TIME_PERCENTILE_95,RESPONSE_TIME_PERCENTILE_99 - Volume:
HITS_TOTAL,HITS_SUCCESSFUL_TOTAL,THROUGHPUT_TOTAL - Errors:
ERRORS_TOTAL,ERRORS_RATE,ERRORS_PERCENT - Network:
SENT_BYTES_TOTAL,CONNECT_TIME_AVG,LATENCY_AVG
π Typical usage workflow
1. Resource discovery
# 1. List workspaces
octoperf_get_current_user_workspaces
# 2. List projects in a workspace
get_project_by_workspace_id workspaceId="abc123"
# 3. Retrieve runtime IDs for a project
get_runtime_id projectId="def456"
2. Test execution
# 4. Start a test
octoperf_run_test runtimeId="ghi789"
# 5. Check status
octoperf_status benchResultId="jkl012"
3. Results analysis
# 6. Retrieve a complete report
octoperf_report reportId="mno345"
# 7. Retrieve specific metrics
octoperf_get_report_metrics benchResultId="jkl012" metricIds=["HITS_TOTAL","ERRORS_TOTAL","RESPONSE_TIME_AVG"]
π§ MCP Configuration for VS Code
The .vscode/mcp.json file automatically configures the MCP server in VS Code with secure API key handling.
Detailed structure of .vscode/mcp.json file:
{
"inputs": [
{
"type": "promptString",
"id": "octoperf-api-key",
"description": "OctoPerf API Key",
"password": true
}
],
"servers": {
"octoperf": {
"command": "go",
"args": [
"run",
"."
],
"type": "stdio",
"env": {
"OCTOPERF_API_KEY": "${input:octoperf-api-key}"
}
}
}
}
Key Features:
- Secure API Key Storage: Uses VS Code's secure credential storage
- Automatic Prompting: API key is requested only on first use
- No Plain Text: API keys are never stored in configuration files
- Seamless Integration: Works automatically with Claude Dev and other MCP clients
First-time Setup Flow:
- Clone the repository
- Create the
.vscode/mcp.jsonconfiguration file as shown above - Start VS Code or restart the MCP server
- VS Code will prompt: "OctoPerf API Key"
- Enter your API key (input will be masked as it's marked as password)
- The key is securely stored and automatically used for future sessions
Alternative for local development:
{
"inputs": [
{
"type": "promptString",
"id": "octoperf-api-key",
"description": "OctoPerf API Key",
"password": true
}
],
"servers": {
"octoperf": {
"command": "go",
"args": ["run", "."],
"cwd": "/path/to/your/mvp-mcp-octoperf",
"type": "stdio",
"env": {
"OCTOPERF_API_KEY": "${input:octoperf-api-key}"
}
}
}
}
ποΈ Technical architecture
Abstraction layers
-
Handler Layer (
handler.go): MCP Interface- MCP parameter extraction
- Type validation and conversion
- Response formatting
-
Business Layer (
octoperf/adapter.go): OctoPerf Client- API authentication
- HTTP request construction
- API error handling
-
Transport Layer: HTTP with Resty
- Connection management
- Retry and timeouts
- Request logging
Main dependencies
require (
github.com/mark3labs/mcp-go v0.35.0 // MCP Framework
github.com/go-resty/resty/v2 v2.16.5 // HTTP Client
)
π Security
- β API keys are never stored in plain text
- β Uses VS Code's secure credential storage system
- β API key prompting with masked input (password field)
- β
.vscode/mcp.jsoncontains no sensitive data - β Automatic Bearer authentication
- β Input parameter validation
- β οΈ No log encryption (contains API responses)
Security Best Practices:
- The
mcp.jsonfile is safe to commit (contains no secrets) - API keys are stored in VS Code's secure credential manager
- Regenerate API keys regularly in OctoPerf dashboard
- Create the configuration file manually for enhanced security
π¨ Known limitations
- No support for parallel tests
- Fixed API timeout (not configurable)
- Basic network error handling
- No API result caching
π License
Distributed under the MIT License.
You are free to use, modify, and redistribute it under the terms of this license.
π Support
- OctoPerf Documentation: https://doc.octoperf.com/
- MCP Protocol: https://modelcontextprotocol.io/
- GitHub Issues: Create a ticket
