Skip to main content
Glama
README.md
# Mockery.MCP

An MCP (Model Context Protocol) server that provides tools for interacting with a [Mockery](https://github.com/busadave13/Mockery) HTTP mock response server. This allows AI agents like Cline to manage mock files through a standardized interface.

## Features

- **get_mock** - Retrieve mock content with status codes and content types
- **list_mocks** - Browse directories and files on the Mockery server
- **create_mock** - Create new mock files (with Git auto-commit support)
- **delete_mock** - Remove mock files (with Git auto-commit support)

## Prerequisites

- [Node.js](https://nodejs.org/) v18 or higher
- [npm](https://www.npmjs.com/)
- A running [Mockery](https://github.com/busadave13/Mockery) server

## Installation from GitHub

1. Clone the repository:
   ```bash
   git clone https://github.com/busadave13/Mockery.MCP.git
   cd Mockery.MCP
   ```

2. Install dependencies:
   ```bash
   npm install
   ```

3. Build the project:
   ```bash
   npm run build
   ```

## Using with Cline

To use this MCP server with [Cline](https://github.com/cline/cline), add the following configuration to your Cline MCP settings file.

### Configuration Location

- **Windows**: `%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json`
- **macOS**: `~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json`
- **Linux**: `~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json`

### Configuration

Add this entry to your `cline_mcp_settings.json`:

```json
{
  "mcpServers": {
    "mockery": {
      "command": "node",
      "args": ["C:/path/to/Mockery.MCP/build/index.js"],
      "env": {
        "MOCKERY_BASE_URL": "http://localhost:8080"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}
```

> **Note**: Replace `C:/path/to/Mockery.MCP` with the actual path where you cloned the repository.

### Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `MOCKERY_BASE_URL` | Base URL of your Mockery server | `http://localhost:8080` |

## Available Tools

### get_mock

Retrieve mock content from the Mockery server.

**Parameters:**
- `mockId` (required): The mock ID in format `ServiceName/FileId` (e.g., `FooBar/1234`, `Products/hydrate`)
  - For random selection from multiple mocks, use comma-separated values: `FooBar/1234,FooBar/5678`

**Returns:** Status code, content type, and mock content

### list_mocks

List directories and files at a specified path.

**Parameters:**
- `path` (optional): Path to list (e.g., `weather/prod`). Defaults to root `/`

**Returns:** Folders and files with metadata

### create_mock

Create a new mock file on the Mockery server.

**Parameters:**
- `path` (required): Path including filename (e.g., `weather/prod/success.json`)
- `content` (required): File content (JSON, HTML, XML, text, etc.)

**Returns:** Confirmation of creation

### delete_mock

Delete a mock file from the Mockery server.

**Parameters:**
- `path` (required): Path to the mock file to delete (e.g., `weather/prod/success.json`)

**Returns:** Confirmation of deletion

## Development

```bash
# Install dependencies
npm install

# Build the project
npm run build

# Run the server (for testing)
npm start
```

## License

MIT License - see [LICENSE](LICENSE) for details.

TDQS

A3.9/5.0

Scored across 4 tools

Disambiguation5/5

Each tool maps to a distinct CRUD-style action on a single resource (mock files): get, list, create, delete. There is no realistic risk of confusing one for another, and create/delete semantics are further clarified by the Git-mode behavior.

Naming Consistency5/5

All four tools follow a strict verb_noun pattern (get_mock, list_mocks, create_mock, delete_mock) with consistent snake_case. The only variation is the natural plural in list_mocks, which does not break the pattern.

Tool Count5/5

Four tools is a well-scoped surface for a mock-file store, with each tool earning its place and no redundant variants. Nothing feels missing on the count dimension alone.

Completeness4/5

The surface covers read, list, create, and delete, including directory creation and cleanup, which handles most workflows. There is no explicit update/edit or move/rename operation, so modifying existing mock content depends on re-creating the file.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues