REST API Tester MCP server

Integrates with REST API's via Axios to provide a command-line tool for testing and debugging REST APIs with customizable requests and response analysis.
Back to servers
Setup instructions
Provider
Christia Pedersen
Release date
Dec 21, 2024
Language
TypeScript
Package
Stats
1.8K downloads
51 stars

The MCP REST API Tester is a TypeScript-based server that allows you to test and interact with any REST API endpoints directly from your development environment through Cline. It provides detailed request/response information and handles authentication automatically.

Installation Options

Installing via Smithery

To install REST API Tester for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install dkmaker-mcp-rest-api --client claude

Installing Manually

First, install the package globally:

npm install -g dkmaker-mcp-rest-api

Then, configure Cline Custom Instructions by adding the following to your Cline settings (Settings > Custom Instructions):

# REST API Testing Instructions

The `test_request` tool enables testing, debugging, and interacting with REST API endpoints. The tool provides comprehensive request/response information and handles authentication automatically.

## When to Use

- Testing specific API endpoints
- Debugging API responses
- Verifying API functionality
- Checking response times
- Validating request/response formats
- Testing local development servers
- Testing API sequences
- Verifying error handling

## Key Features

- Supports GET, POST, PUT, DELETE, PATCH methods
- Handles authentication (Basic, Bearer, API Key)
- Normalizes endpoints automatically
- Provides detailed response information
- Configurable SSL verification and response limits

## Resources

The following resources provide detailed documentation:

- examples: Usage examples and common patterns
- response-format: Response structure and fields
- config: Configuration options and setup guide

Access these resources to understand usage, response formats, and configuration options.

## Important Notes

- Review API implementation for expected behavior
- Handle sensitive data appropriately
- Consider rate limits and API constraints
- Restart server after configuration changes

Configuration

Add the server to your MCP configuration based on your operating system:

Windows Configuration

⚠️ IMPORTANT: Due to a known issue with Windows path resolution, you must use the full path instead of %APPDATA%.

Add to C:\Users\<YourUsername>\AppData\Roaming\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json:

{
  "mcpServers": {
    "rest-api": {
      "command": "node",
      "args": [
        "C:/Users/<YourUsername>/AppData/Roaming/npm/node_modules/dkmaker-mcp-rest-api/build/index.js"
      ],
      "env": {
        "REST_BASE_URL": "https://api.example.com",
        "AUTH_BASIC_USERNAME": "your-username",
        "AUTH_BASIC_PASSWORD": "your-password",
        "REST_ENABLE_SSL_VERIFY": "false",
        "REST_RESPONSE_SIZE_LIMIT": "10000",
        "HEADER_X-API-Version": "2.0",
        "HEADER_Custom-Client": "my-client",
        "HEADER_Accept": "application/json"
      }
    }
  }
}

macOS Configuration

Add to ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json:

{
  "mcpServers": {
    "rest-api": {
      "command": "npx",
      "args": [
        "-y",
        "dkmaker-mcp-rest-api"
      ],
      "env": {
        "REST_BASE_URL": "https://api.example.com",
        "AUTH_BASIC_USERNAME": "your-username",
        "AUTH_BASIC_PASSWORD": "your-password",
        "REST_ENABLE_SSL_VERIFY": "false",
        "HEADER_X-API-Version": "2.0",
        "HEADER_Custom-Client": "my-client",
        "HEADER_Accept": "application/json"
      }
    }
  }
}

Authentication Options

Only configure one authentication method at a time:

  1. Basic Authentication:

    AUTH_BASIC_USERNAME: "your-username"
    AUTH_BASIC_PASSWORD: "your-password"
    
  2. Bearer Token (if Basic Auth is not configured):

    AUTH_BEARER: "your-token"
    
  3. API Key (if neither Basic Auth nor Bearer Token is configured):

    AUTH_APIKEY_HEADER_NAME: "X-API-Key"
    AUTH_APIKEY_VALUE: "your-api-key"
    

Key Features

  • Support for multiple HTTP methods: GET, POST, PUT, DELETE, and PATCH
  • Detailed response information including status, headers, and body
  • Custom headers support:
    • Global headers via HEADER_* environment variables
    • Priority-based application (per-request > auth > custom)
  • Configurable response size limit (default: 10KB/10000 bytes)
  • SSL certificate verification control (enabled by default)

Usage Examples

Once installed and configured, you can use the REST API Tester through Cline:

Simple GET Request

use_mcp_tool('rest-api', 'test_request', {
  "method": "GET",
  "endpoint": "/users"
});

POST Request with Body

use_mcp_tool('rest-api', 'test_request', {
  "method": "POST",
  "endpoint": "/users",
  "body": {
    "name": "John Doe",
    "email": "[email protected]"
  }
});

Request with Custom Headers

use_mcp_tool('rest-api', 'test_request', {
  "method": "GET",
  "endpoint": "/products",
  "headers": {
    "Accept-Language": "en-US",
    "X-Custom-Header": "custom-value"
  }
});

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "rest-api" '{"command":"npx","args":["-y","dkmaker-mcp-rest-api"],"env":{"REST_BASE_URL":"https://api.example.com"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "rest-api": {
            "command": "npx",
            "args": [
                "-y",
                "dkmaker-mcp-rest-api"
            ],
            "env": {
                "REST_BASE_URL": "https://api.example.com"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "rest-api": {
            "command": "npx",
            "args": [
                "-y",
                "dkmaker-mcp-rest-api"
            ],
            "env": {
                "REST_BASE_URL": "https://api.example.com"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later