> ## Documentation Index
> Fetch the complete documentation index at: https://docs.loadforge.com/llms.txt
> Use this file to discover all available pages before exploring further.

# LoadForge REST API Reference

> Complete API documentation for LoadForge load testing — manage hosts, tests, runs, and results programmatically.

## Overview

LoadForge provides a comprehensive REST-based API service that enables you to automate your load testing workflows and analyze results programmatically. This documentation covers all available endpoints and their usage.

<Note>
  All API requests require authentication using a Bearer token. Create your token in the [User Menu - API](https://app.loadforge.com/user/api-tokens) section.
</Note>

## Base URL

All API requests should be made to:

```text theme={null}
https://app.loadforge.com/api/v2
```

## Authentication

<CodeGroup>
  ```bash Authorization Header theme={null}
  Authorization: Bearer YOUR_TOKEN_HERE
  ```

  ```json OpenAPI Security Schema theme={null}
  {
    "security": [
      {
        "bearerAuth": []
      }
    ]
  }
  ```
</CodeGroup>

## Core Endpoints

<CardGroup cols={2}>
  <Card title="Hosts API" icon="network-wired">
    Manage test targets by creating, listing, and deleting host configurations
  </Card>

  <Card title="Tests API" icon="flask">
    Handle test configurations including creation, updates, and deletion
  </Card>

  <Card title="Results API" icon="chart-mixed">
    Access detailed test results and performance metrics
  </Card>

  <Card title="Run API" icon="circle-play">
    Control test execution with start and cancel operations
  </Card>
</CardGroup>

## Model Context Protocol (MCP) Integration

### Overview

LoadForge now supports the **Model Context Protocol (MCP)**, enabling seamless integration with other MCP-compatible services for enhanced automation and workflow management.

<Tip>
  MCP integration allows you to automate test execution, streamline workflows, and enable cross-platform compatibility with other tools in your stack.
</Tip>

### Getting Started with MCP

To add LoadForge as an MCP service:

```bash theme={null}
npx @mintlify/mcp@latest add loadforge
```

### Key Benefits

<AccordionGroup>
  <Accordion title="Automated Load Testing" icon="robot">
    * Trigger tests from CI/CD pipelines
    * Schedule performance monitoring
    * Set up threshold-based testing
  </Accordion>

  <Accordion title="Unified Service Management" icon="gear">
    * Centralized configuration management
    * Simplified test scheduling
    * Consolidated logging and reporting
  </Accordion>

  <Accordion title="Enhanced Scalability" icon="arrows-up-down-left-right">
    * Dynamic test scaling
    * Multi-location test execution
    * Integration with monitoring tools
  </Accordion>
</AccordionGroup>

### Example MCP Workflow

Here's a sample workflow that demonstrates how to trigger LoadForge tests using MCP:

```json theme={null}
{
  "name": "LoadForge Test Workflow",
  "steps": [
    {
      "service": "loadforge",
      "action": "runTest",
      "parameters": {
        "testId": "123456",
        "schedule": "@hourly"
      }
    }
  ]
}
```

### Implementation Steps

<Steps>
  <Step title="Install MCP Integration">
    Run `npx mcp add loadforge` to set up the integration
  </Step>

  <Step title="Configure Workflows">
    Create automated workflows that trigger load tests based on your requirements
  </Step>

  <Step title="Monitor and Optimize">
    Track test results and adjust performance parameters as needed
  </Step>
</Steps>

<Info>
  By integrating LoadForge with MCP, you can create powerful automated testing workflows that enhance your performance testing strategy.
</Info>
