Skip to main content
Glama
dkmaker

mcp-rest-api

MCP REST API テスター

ライセンス: MIT NPMパッケージ 鍛冶屋のバッジ

Cline を介して REST API のテストを可能にする TypeScript ベースの MCP サーバーです。このツールを使用すると、開発環境から任意の REST API エンドポイントを直接テストし、操作できます。

インストール

Smithery経由でインストール

Smithery経由で Claude Desktop 用の REST API Tester を自動的にインストールするには:

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

手動でインストールする

  1. パッケージをグローバルにインストールします。

npm install -g dkmaker-mcp-rest-api
  1. Clineカスタム手順を構成する:

Cline がこのツールを効果的に使用する方法を理解できるようにするには、Cline のカスタム指示に次の内容を追加します (設定 > カスタム指示)。

# 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 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
  1. サーバーを MCP 構成に追加します。

これらの手順はCline向けですが、サーバーはどのMCP実装でも動作するはずです。お使いのオペレーティングシステムに合わせて設定してください。

ウィンドウズ

⚠️重要: Windows パス解決に関する既知の問題 (問題 #40 ) のため、%APPDATA% ではなく完全なパスを使用する必要があります。

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",
        // Basic Auth
        "AUTH_BASIC_USERNAME": "your-username",
        "AUTH_BASIC_PASSWORD": "your-password",
        // OR Bearer Token
        "AUTH_BEARER": "your-token",
        // OR API Key
        "AUTH_APIKEY_HEADER_NAME": "X-API-Key",
        "AUTH_APIKEY_VALUE": "your-api-key",
        // SSL Verification (enabled by default)
        "REST_ENABLE_SSL_VERIFY": "false", // Set to false to disable SSL verification for self-signed certificates
        // Response Size Limit (optional, defaults to 10000 bytes)
        "REST_RESPONSE_SIZE_LIMIT": "10000", // Maximum response size in bytes
        // Custom Headers (optional)
        "HEADER_X-API-Version": "2.0",
        "HEADER_Custom-Client": "my-client",
        "HEADER_Accept": "application/json"
      }
    }
  }
}

macOS

~/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",
        // Basic Auth
        "AUTH_BASIC_USERNAME": "your-username",
        "AUTH_BASIC_PASSWORD": "your-password",
        // OR Bearer Token
        "AUTH_BEARER": "your-token",
        // OR API Key
        "AUTH_APIKEY_HEADER_NAME": "X-API-Key",
        "AUTH_APIKEY_VALUE": "your-api-key",
        // SSL Verification (enabled by default)
        "REST_ENABLE_SSL_VERIFY": "false", // Set to false to disable SSL verification for self-signed certificates
        // Custom Headers (optional)
        "HEADER_X-API-Version": "2.0",
        "HEADER_Custom-Client": "my-client",
        "HEADER_Accept": "application/json"
      }
    }
  }
}

注: 環境変数は実際の値に置き換えてください。認証方法は一度に1つだけ設定してください。

  1. 基本認証(ユーザー名/パスワード)

  2. ベアラートークン(Basic 認証が設定されていない場合)

  3. APIキー(Basic認証もベアラートークンも設定されていない場合)

Related MCP server: Notion Knowledge Base MCP Server

特徴

  • さまざまなHTTPメソッドでREST APIエンドポイントをテストする

  • GET、POST、PUT、DELETEリクエストのサポート

  • ステータス、ヘッダー、本文を含む詳細な応答情報

  • カスタム ヘッダー:

    • HEADER_*環境変数によるグローバルヘッダー

    • 大文字と小文字を区別しない接頭辞 (HEADER_、header_、HeAdEr_)

    • ヘッダー名の大文字と小文字の保持

    • 優先度ベースのアプリケーション(リクエストごと > 認証 > カスタム)

  • POST/PUTメソッドのリクエストボディの処理

  • レスポンスサイズの管理:

    • 自動応答サイズ制限(デフォルト: 10KB/10000バイト)

    • REST_RESPONSE_SIZE_LIMIT環境変数によるサイズ制限の設定

    • 応答が制限を超えた場合に切り捨てメタデータをクリアする

    • 本文の内容のみを切り捨てながらレスポンス構造を保持します

  • SSL証明書の検証:

    • 安全な操作のためデフォルトで有効

    • 自己署名証明書または開発環境では無効にすることができます

    • REST_ENABLE_SSL_VERIFY環境変数による制御

  • 複数の認証方法:

    • 基本認証(ユーザー名/パスワード)

    • ベアラートークン認証

    • APIキー認証(カスタムヘッダー)

使用例

インストールと構成が完了したら、Cline を通じて REST API テスターを使用して API エンドポイントをテストできます。

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

// Test a POST endpoint with body
use_mcp_tool('rest-api', 'test_request', {
  "method": "POST",
  "endpoint": "/users",
  "body": {
    "name": "John Doe",
    "email": "john@example.com"
  }
});

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

発達

  1. リポジトリをクローンします。

git clone https://github.com/zenturacp/mcp-rest-api.git
cd mcp-rest-api
  1. 依存関係をインストールします:

npm install
  1. プロジェクトをビルドします。

npm run build

自動リビルドを使用した開発の場合:

npm run watch

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dkmaker/mcp-rest-api'

If you have feedback or need assistance with the MCP directory API, please join our Discord server