mcp-tester-helper

mcp-tester-helper

A unified MCP server for multi-stand infrastructure testing, enabling REST API calls, PostgreSQL queries, and OpenSearch searches through a single config file.

Category
访问服务器

README

mcp-tester-helper

A unified MCP (Model Context Protocol) server for multi-stand infrastructure testing: REST APIs, PostgreSQL databases, and OpenSearch — all through a single config file.

Built for DevOps, QA, and developers who need AI-assisted testing across multiple environments (stands).

Features

  • 🔀 Multi-stand — switch between dev / test / prod environments via config
  • 🔒 Secure auth — OAuth tokens and DB credentials stay server-side, never exposed in AI chat
  • 🌐 REST API — test any microservice endpoint with auto-authentication
  • 🐘 PostgreSQL — run SQL queries with connection pooling and read-only safety
  • 🔍 OpenSearch — search logs, list indices, inspect mappings via Query DSL
  • 📋 Service Discovery — AI can list available stands and services
  • ❤️ Health Checks — verify stand infrastructure availability

Quick Start

npx -y mcp-tester-helper --config ./config.json

Configuration

MCP Client Setup

Add to your MCP client configuration (Claude Desktop, Antigravity, Cursor, etc.):

{
  "mcpServers": {
    "infra": {
      "command": "npx",
      "args": ["-y", "mcp-tester-helper", "--config", "/path/to/config.json"],
      "env": {
        "STAGING_USERNAME": "admin",
        "STAGING_PASSWORD": "secret",
        "REST_ENABLE_SSL_VERIFY": "false"
      }
    }
  }
}

Config File (config.json)

{
  "stands": {
    "dev": {
      "auth": {
        "url": "https://auth.dev.example.com/oauth/token",
        "type": "json",
        "user": "DEV_USERNAME",
        "pass": "DEV_PASSWORD"
      },
      "elastic": {
        "url": "https://opensearch.dev.example.com:9200",
        "user": "DEV_ELASTIC_USER",
        "pass": "DEV_ELASTIC_PASS"
      },
      "database": {
        "host": "db.dev.example.com",
        "port": 5432,
        "db": "dev_db",
        "user": "DEV_DB_USER",
        "pass": "DEV_DB_PASS"
      },
      "services": {
        "billing": {
          "url": "https://billing.dev.example.com/api",
          "openapi": "api-docs/billing.json"
        }
      }
    }
  }
}

Note: user and pass fields contain environment variable names, not actual credentials. Actual values come from .env file or MCP client env config.

Auth Types

Type Description Content-Type
json (default) {"username":"...","password":"..."} application/json
oauth2 grant_type=password&username=...&password=... x-www-form-urlencoded

Environment Variables

Variable Description Default
REST_RESPONSE_SIZE_LIMIT Max response body size in bytes 10000
REST_ENABLE_SSL_VERIFY Set to false to skip SSL cert verification true

Tools Reference

test_request — HTTP API Calls

Test a REST API endpoint with auto-authentication.

{
  "stand": "staging",
  "service": "orders",
  "method": "GET",
  "endpoint": "/api/v1/health"
}
Parameter Required Description
stand ✅ Target stand name
service ✅ Service name from config, or "elastic" for OpenSearch
method ✅ GET, POST, PUT, DELETE, PATCH
endpoint ✅ Path (e.g. /api/v1/users)
body Request body (for POST/PUT/PATCH)
headers Extra headers (don't pass Authorization)

db_query — PostgreSQL Queries

Execute read-only SQL queries with connection pooling.

{ "stand": "staging", "query": "SELECT * FROM schema.table LIMIT 10" }

All queries run inside BEGIN TRANSACTION READ ONLY — data modifications are blocked.

os_search — OpenSearch Query DSL

Search OpenSearch indices using the full Query DSL.

{
  "stand": "staging",
  "index": "app-logs-*",
  "query_body": {
    "query": { "match": { "level": "ERROR" } },
    "size": 10,
    "sort": [{ "@timestamp": "desc" }]
  },
  "fields": ["@timestamp", "message", "level"]
}

os_indices — List OpenSearch Indices

{ "stand": "staging", "index_pattern": "app-logs-*" }

os_mappings — Index Mappings

{ "stand": "staging", "index": "app-logs-2025.07" }

list_services — Service Discovery

{ "stand": "staging" }

Returns all services, database, and OpenSearch info for the stand.

health — Infrastructure Health Check

{ "stand": "staging", "target": "all" }

Pings services, OpenSearch, and PostgreSQL. Returns status and timing for each.

Security

  • 🔐 Auth tokens are obtained automatically and cached server-side (with TTL)
  • 🚫 Credentials never appear in tool responses sent to the AI
  • 🔄 Automatic token refresh on 401 responses
  • 📖 All SQL queries are wrapped in read-only transactions
  • ✂️ Response bodies are truncated to prevent token overflow

Credits & Attribution

This project is built upon and inspired by the following open-source projects:

  • dkmaker/mcp-rest-api (MIT License) — REST API testing MCP server, used as the foundation for HTTP client and MCP server structure.

  • modelcontextprotocol/servers — server-postgres (MIT License) — Official PostgreSQL MCP reference implementation. Connection pooling and read-only transaction patterns.

  • elastic/mcp-server-elasticsearch (Apache-2.0 License) — Official Elasticsearch MCP server. Tool design for search, indices, and mappings (reimplemented from Rust to TypeScript for OpenSearch compatibility).

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选