API Tester MCP Server

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

Integrations

  • Supports secure API key management through .env files, allowing users to store sensitive credentials like OpenAI API keys without exposing them in chat.

  • Supports environment variable configuration on Linux systems when setting up API keys for service integrations.

  • Provides environment variable configuration support for macOS systems when setting up API keys for service integrations.

API 测试器 MCP 服务器

这是一个模型上下文协议 (MCP) 服务器,允许 Claude 代表您发出 API 请求。它提供了用于测试各种 API 的工具,包括与 OpenAI API 的专用集成。

特征

  • 向任何 API 发出 HTTP 请求(GET、POST、PUT、DELETE)
  • 无需在聊天中分享 API 密钥即可测试 OpenAI 的 GPT 模型
  • 使用 DALL-E 生成图像
  • 格式正确,方便阅读的回复

设置

先决条件

  • Python 3.10 或更高版本
  • MCP SDK 1.2.0 或更高版本

安装

  1. 安装所需的依赖项:
pip install "mcp[cli]" httpx python-dotenv
  1. 使用以下方法之一设置您的 OpenAI API 密钥:

选项 1:环境变量

# On Windows (PowerShell) $env:OPENAI_API_KEY = "your-api-key" # On Windows (Command Prompt) set OPENAI_API_KEY=your-api-key # On macOS/Linux export OPENAI_API_KEY="your-api-key"

选项 2:使用 .env 文件(推荐)

在项目目录中创建一个.env文件(从.env.example复制):

OPENAI_API_KEY=your_openai_api_key_here

运行服务器

python main.py

与 Claude 一起使用

一旦您的服务器运行,您就可以通过在 Claude Desktop 配置文件中进行配置将其连接到 Claude for Desktop。

示例提示

常规 API 测试

Use the get_request tool to fetch data from https://jsonplaceholder.typicode.com/posts/1
Use the post_request tool to send data to https://jsonplaceholder.typicode.com/posts with this JSON body: {"title": "Test Post", "body": "This is a test", "userId": 1}

使用 OpenAI 工具

Use the openai_chat_completion tool with: prompt: "Write a short poem about artificial intelligence" system_message: "You are a helpful assistant that writes creative poetry" model: "gpt-4"
Use the openai_image_generation tool with: prompt: "A futuristic city with flying cars and tall glass buildings at sunset" size: "1024x1024"

可用工具

通用 API 工具

  • get_request :向任何 URL 发出 GET 请求
  • post_request :使用 JSON 主体发出 POST 请求
  • put_request :使用 JSON 主体发出 PUT 请求
  • delete_request :发出 DELETE 请求

OpenAI 专用工具

  • openai_chat_completion :使用 OpenAI 的聊天模型生成文本
  • openai_image_generation :使用 DALL-E 生成图像

安全说明

  • 您的 OpenAI API 密钥存储在服务器中,不会在聊天中暴露
  • API 使用将计入您的 OpenAI 配额,并可能产生费用
  • 对于生产用途,请始终将 API 密钥设置为环境变量或使用.env文件
  • .env文件包含在.gitignore中,以防止意外提交您的 API 密钥
-
security - not tested
F
license - not found
-
quality - not tested

模型上下文协议服务器允许 Claude 代表您发出 API 请求,提供测试各种 API 的工具,包括 HTTP 请求和 OpenAI 集成,而无需在聊天中共享您的 API 密钥。

  1. Features
    1. Setup
      1. Prerequisites
      2. Installation
      3. Running the Server
    2. Using with Claude
      1. Example Prompts
    3. Available Tools
      1. General API Tools
      2. OpenAI-Specific Tools
    4. Security Notes
      ID: bcp8tgdqzn