Skip to main content
Glama
mcp-server-apidebug

mcp-server-apidebug

by liliangshan

mcp-server-apidebug

English | 中文


English

MCP Server for API Debugging

API 디버깅, 로그인 인증, API 구성 관리 및 인덱스 기반 API 실행을 위한 독립형 MCP(Model Context Protocol) 서버입니다.

Features

  • api_config: API 디버깅 구성, Base URL, 공통 헤더 및 API 목록 관리

  • api_debug: API 요청 직접 실행, GET/POST/PUT/DELETE/PATCH 메서드, 쿼리 매개변수, 헤더, 본문 지원, Content-Type 자동 감지

  • api_execute: api_config에 저장된 인덱스로 요청 실행

  • api_login: 환경 변수를 기반으로 로그인 요청 실행

  • api_help: API 디버깅 도구 문서 및 예제 보기

Installation

전역 설치 (권장):

npm install -g @liangshanli/mcp-server-apidebug

로컬 설치:

npm install @liangshanli/mcp-server-apidebug

Local Development

npm start

또는 서버 직접 시작:

node src/server.js

Quick Self-Test

npm test

MCP tools/list 결과를 출력합니다.

Environment Variables

변수

기본값

설명

PROJECT_PATH

.

프로젝트 디렉토리; 설정되지 않은 경우 현재 디렉토리 사용

TOOL_PREFIX

default

도구 이름 접두사; 기본 도구는 default_api_debug, default_api_config 등

CONFIG_DIR

비어 있음

선택적 구성 디렉토리 재정의; 일반적으로 필요하지 않음. 설정되지 않은 경우 PROJECT_PATH/.setting/{TOOL_PREFIX} 사용

API_DEBUG_BASE_URL

비어 있음

API 기본 URL; 구성된 경우 api_config를 통해 baseUrl을 설정할 필요 없음

API_DEBUG_ALLOWED_METHODS

GET,POST,PUT,DELETE,PATCH

허용된 HTTP 메서드 (쉼표로 구분)

API_DEBUG_LOGIN_URL

/api/login

로그인 API URL

API_DEBUG_LOGIN_METHOD

POST

로그인 API 메서드

API_DEBUG_LOGIN_BODY

{"username":"","password":""}

로그인 요청 본문, JSON 문자열 또는 일반 문자열 지원

API_DEBUG_LOGIN_DESCRIPTION

비어 있음

로그인 도구 설명

API_DEBUG_LOGIN_USER_HEADER

new-api-user

사용자 ID용 헤더 이름 (로그인 응답에서 추출)

MCP Configuration Example

{
  "servers": {
    "apidebug": {
      "command": "npx",
      "args": [
        "@liangshanli/mcp-server-apidebug"
      ],
      "env": {
        "API_DEBUG_BASE_URL": "https://api.example.com",
        "API_DEBUG_ALLOWED_METHODS": "GET,POST,PUT,DELETE,PATCH",
        "API_DEBUG_LOGIN_URL": "/api/user/login",
        "API_DEBUG_LOGIN_METHOD": "POST",
        "API_DEBUG_LOGIN_BODY": "{\"username\":\"your_username\",\"password\":\"your_password\"}",
        "API_DEBUG_LOGIN_USER_HEADER": "new-api-user",
        "API_DEBUG_LOGIN_DESCRIPTION": "Execute login requests based on environment variables. Use api_config interface to handle login configuration after successful login."
      }
    }
  }
}

Configuration Storage

기본 저장 경로:

{PROJECT_PATH}/.setting/{TOOL_PREFIX}/api.json

PROJECT_PATH가 설정되지 않은 경우 기본값은 .이며, TOOL_PREFIX가 설정되지 않은 경우 기본값은 default입니다.

Usage Examples

  1. Base URL 설정:

{
  "action": "updateBaseUrl",
  "baseUrl": "https://api.example.com"
}
  1. API 디버깅:

{
  "url": "/api/users",
  "method": "GET",
  "query": {
    "page": 1,
    "limit": 10
  }
}
  1. API 추가 및 인덱스로 실행:

{
  "action": "addApi",
  "api": {
    "url": "/api/login",
    "method": "POST",
    "body": {
      "username": "admin",
      "password": "123456"
    }
  }
}
{
  "index": 0
}

Related MCP server: Postmancer

中文

API 调试 MCP 服务器

独立运行的 MCP (Model Context Protocol) 服务器,用于 API 调试、登录认证、API 配置管理和按索引执行 API 请求。

工具列表

  • api_config:管理 API 调试配置、Base URL、公共 Headers 和接口列表

  • api_debug:直接执行 API 请求,支持 GET/POST/PUT/DELETE/PATCH 方法、query 参数、headers、body,自动检测 Content-Type

  • api_execute:按 api_config 中保存的接口索引执行请求

  • api_login:根据环境变量执行登录请求

  • api_help:查看 API 调试工具说明和示例

安装依赖

全局安装(推荐):

npm install -g @liangshanli/mcp-server-apidebug

本地安装:

npm install @liangshanli/mcp-server-apidebug

本地运行

npm start

或直接启动 server:

node src/server.js

快速自检

npm test

会输出 MCP tools/list 结果。

环境变量

变量

默认值

说明

PROJECT_PATH

.

项目目录;不设置时使用当前目录

TOOL_PREFIX

default

工具名前缀;默认工具名为 default_api_debug、default_api_config 等

CONFIG_DIR

空

可选覆盖配置目录;一般不需要设置。未设置时使用 PROJECT_PATH/.setting/{TOOL_PREFIX}

API_DEBUG_BASE_URL

空

API 基础 URL;配置后无需再通过 api_config 设置 baseUrl

API_DEBUG_ALLOWED_METHODS

GET,POST,PUT,DELETE,PATCH

允许执行的 HTTP 方法,逗号分隔

API_DEBUG_LOGIN_URL

/api/login

登录接口 URL

API_DEBUG_LOGIN_METHOD

POST

登录接口方法

API_DEBUG_LOGIN_BODY

{"username":"","password":""}

登录请求体,支持 JSON 字符串或普通字符串

API_DEBUG_LOGIN_DESCRIPTION

空

登录工具说明

API_DEBUG_LOGIN_USER_HEADER

new-api-user

用户 ID 的 Header 名称(从登录响应中提取)

MCP 配置示例

{
  "servers": {
    "apidebug": {
      "command": "npx",
      "args": [
        "@liangshanli/mcp-server-apidebug"
      ],
      "env": {
        "API_DEBUG_BASE_URL": "https://api.example.com",
        "API_DEBUG_ALLOWED_METHODS": "GET,POST,PUT,DELETE,PATCH",
        "API_DEBUG_LOGIN_URL": "/api/user/login",
        "API_DEBUG_LOGIN_METHOD": "POST",
        "API_DEBUG_LOGIN_BODY": "{\"username\":\"your_username\",\"password\":\"your_password\"}",
        "API_DEBUG_LOGIN_USER_HEADER": "new-api-user",
        "API_DEBUG_LOGIN_DESCRIPTION": "根据环境变量执行登录请求。使用 api_config 接口处理登录成功后的配置。"
      }
    }
  }
}

配置保存路径

默认保存目录规则:

{PROJECT_PATH}/.setting/{TOOL_PREFIX}/api.json

如果 PROJECT_PATH 不设置,则默认 .;如果 TOOL_PREFIX 不设置,则默认 default。

使用示例

  1. 设置 Base URL:

{
  "action": "updateBaseUrl",
  "baseUrl": "https://api.example.com"
}
  1. 调试接口:

{
  "url": "/api/users",
  "method": "GET",
  "query": {
    "page": 1,
    "limit": 10
  }
}
  1. 添加接口后按索引执行:

{
  "action": "addApi",
  "api": {
    "url": "/api/login",
    "method": "POST",
    "body": {
      "username": "admin",
      "password": "123456"
    }
  }
}
{
  "index": 0
}

Available Tools

5 tools
default_api_configB

API configuration management tool for managing API settings, endpoints, and configurations. Examples: get config, set baseUrl to "https://api.example.com", updateHeaders with {"Authorization":"Bearer token"}, search APIs by keyword, list all configured APIs

Inputs: action (required), config, baseUrl, headers, +3 more.

default_api_debugA

API debugging tool for directly executing API requests with automatic content-type detection and flexible body format support. Examples: GET /api/users with query params, POST /api/login with JSON body {"username":"admin","password":"123456"}, PUT /api/users/123 with form data "name=John&email=john@example.com"

Inputs: url, method, headers, query, +2 more.

default_api_executeA

Execute API requests by index from configured API list. Examples: execute API at index 0, execute with overrides {"method":"POST","body":{"key":"value"}}

Inputs: index (required), overrides.

default_api_helpA

API help tool that provides detailed documentation and examples for all API debugging tools. Use this to understand how to use api_debug, api_login, api_config, and api_execute tools effectively

Inputs: tool.

default_api_loginA

API login authentication tool that uses environment variables for login credentials. Automatically extracts token from response and updates Authorization headers. Example: Call with optional baseUrl parameter to override default base URL

Inputs: baseUrl.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 5 tools

    Disambiguation4/5

    Tools have distinct purposes (config, debug, execute, help, login). However, 'debug' and 'execute' both involve executing API requests, differing only in input method, which could cause minor confusion. Descriptions help clarify the distinction.

    Naming Consistency5/5

    All tools follow the consistent 'default_api_<action>' prefix pattern. The action words (config, debug, execute, help, login) are all clear and follow a predictable structure, enabling easy tool selection.

    Tool Count5/5

    With 5 tools, the set is well-scoped for an API debugging server. Each tool addresses a core task (configuration, direct execution, index-based execution, authentication, and help). No tools are superfluous.

    Completeness4/5

    The tool set covers essential API debugging workflows: configuration, authentication, and execution (both direct and by index). Minor gaps exist, such as a tool for viewing execution history or batch operations, but core functionality is solid.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      A standalone MCP server for API testing and management, allowing AI assistants to interact with RESTful APIs through natural language.
      8 npm
      29
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server for making API calls with authentication support. Allows configuring multiple API endpoints and performing GET, POST, PUT, DELETE requests, including form data and file uploads.
      -