Skip to main content
Glama
liliangshan

mcp-server-apidebug

by liliangshan

mcp-server-apidebug

English | 中文


English

MCP-Server für API-Debugging

Ein eigenständiger MCP-Server (Model Context Protocol) für API-Debugging, Login-Authentifizierung, API-Konfigurationsmanagement und indizierte API-Ausführung.

Funktionen

  • api_config: Verwaltung der API-Debugging-Konfiguration, Basis-URL, allgemeine Header und API-Liste

  • api_debug: Direkte Ausführung von API-Anfragen, unterstützt GET/POST/PUT/DELETE/PATCH-Methoden, Abfrageparameter, Header, Body, automatische Content-Type-Erkennung

  • api_execute: Ausführung von Anfragen anhand des in api_config gespeicherten Index

  • api_login: Ausführung von Login-Anfragen basierend auf Umgebungsvariablen

  • api_help: Anzeigen der Dokumentation und Beispiele für API-Debugging-Tools

Installation

Globale Installation (empfohlen):

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

Lokale Installation:

npm install @liangshanli/mcp-server-apidebug

Lokale Entwicklung

npm start

Oder starten Sie den Server direkt:

node src/server.js

Schneller Selbsttest

npm test

Dies gibt das Ergebnis von MCP tools/list aus.

Umgebungsvariablen

Variable

Standard

Beschreibung

PROJECT_PATH

.

Projektverzeichnis; verwendet das aktuelle Verzeichnis, wenn nicht gesetzt

TOOL_PREFIX

default

Präfix für Tool-Namen; Standard-Tools sind default_api_debug, default_api_config usw.

CONFIG_DIR

leer

Optionale Überschreibung des Konfigurationsverzeichnisses; im Allgemeinen nicht erforderlich. Wenn nicht gesetzt, wird PROJECT_PATH/.setting/{TOOL_PREFIX} verwendet

API_DEBUG_BASE_URL

leer

API-Basis-URL; wenn konfiguriert, muss baseUrl nicht über api_config gesetzt werden

API_DEBUG_ALLOWED_METHODS

GET,POST,PUT,DELETE,PATCH

Erlaubte HTTP-Methoden, durch Kommas getrennt

API_DEBUG_LOGIN_URL

/api/login

Login-API-URL

API_DEBUG_LOGIN_METHOD

POST

Login-API-Methode

API_DEBUG_LOGIN_BODY

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

Login-Anfrage-Body, unterstützt JSON-String oder einfachen String

API_DEBUG_LOGIN_DESCRIPTION

leer

Beschreibung des Login-Tools

API_DEBUG_LOGIN_USER_HEADER

new-api-user

Header-Name für die Benutzer-ID (extrahiert aus der Login-Antwort)

MCP-Konfigurationsbeispiel

{
  "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."
      }
    }
  }
}

Konfigurationsspeicherung

Standard-Speicherpfad:

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

Wenn PROJECT_PATH nicht gesetzt ist, wird standardmäßig . verwendet; wenn TOOL_PREFIX nicht gesetzt ist, wird standardmäßig default verwendet.

Anwendungsbeispiele

  1. Basis-URL festlegen:

{
  "action": "updateBaseUrl",
  "baseUrl": "https://api.example.com"
}
  1. Eine API debuggen:

{
  "url": "/api/users",
  "method": "GET",
  "query": {
    "page": 1,
    "limit": 10
  }
}
  1. Eine API hinzufügen und nach Index ausführen:

{
  "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_debugdefault_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
}
Install Server
A
license - permissive license
A
quality
C
maintenance

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A standalone MCP server for API testing and management, allowing AI assistants to interact with RESTful APIs through natural language.
    13
    28
    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.

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

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/liliangshan/mcp-server-apidebug'

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