APIPost MCP 服务器

engineer1024/apipost-mcp
2 Stars 168 次浏览 更新于 2026-08-23

一个为 APIPost 编写的 MCP(模型上下文协议)服务器。它将 APIPost 的开放 API 作为 MCP 工具暴露出来,使得任何兼容 MCP 的 AI 客户端能够通过自然语言直接管理您的 API 项目。

该服务暂未提供标准配置,请参考 README 手动接入

服务介绍

apipost-mcp

中文文档 | English

An MCP (Model Context Protocol) server for APIPost, written in Go.

Exposes APIPost's Open API as MCP tools so that any MCP-compatible AI client (Cursor, Claude Desktop, etc.) can manage your API projects directly through natural language.


Features

Category Tools
User apipost_get_user_info
Teams apipost_list_teams
Projects apipost_list_projects, apipost_get_project, apipost_create_project
APIs apipost_list_apis, apipost_get_apis, apipost_create_api, apipost_create_folder, apipost_update_api, apipost_delete_apis
Testing apipost_list_test_scenes, apipost_list_test_reports

Prerequisites

  • Go 1.21+
  • An APIPost account with an api-token
    • Obtain it from: APIPost Client → Workbench → Project Settings → Open Capabilities → Open API

Build

go build -o apipost-mcp ./cmd/apipost-mcp

Configuration

The server is configured entirely via environment variables:

Variable Required Description
APIPOST_TOKEN Yes Your APIPost api-token
APIPOST_BASE_URL No Override the API base URL (default: https://open.apipost.net)

Usage with Cursor

Add the following to your Cursor MCP settings (~/.cursor/mcp.json):

{
  "mcpServers": {
    "apipost": {
      "command": "/path/to/apipost-mcp",
      "env": {
        "APIPOST_TOKEN": "your-api-token-here"
      }
    }
  }
}

Usage with Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "apipost": {
      "command": "/path/to/apipost-mcp",
      "env": {
        "APIPOST_TOKEN": "your-api-token-here"
      }
    }
  }
}

Tool Reference

apipost_get_user_info

Returns the profile of the authenticated user.

apipost_list_teams

Lists all teams the user belongs to.

apipost_list_projects

Param Type Required Description
team_id string Yes Team ID
action number No 0=all, 1=managed, 2=participated, 3=recycle

apipost_get_project

Param Type Required Description
project_id string Yes Project ID

apipost_create_project

Param Type Required Description
team_id string Yes Team ID
name string Yes Project name
intro string No Description

apipost_list_apis

Param Type Required Description
project_id string Yes Project ID

apipost_get_apis

Param Type Required Description
project_id string Yes Project ID
target_ids string Yes Comma-separated target IDs

apipost_create_api

Param Type Required Description
project_id string Yes Project ID
name string Yes API name
method string Yes HTTP method (GET, POST, …)
url string No Request URL
parent_id string No Parent folder ID (default: "0")
description string No Markdown description
tags string No Comma-separated tags

apipost_create_folder

Param Type Required Description
project_id string Yes Project ID
name string Yes Folder name
parent_id string No Parent folder ID (default: "0")

apipost_update_api

Param Type Required Description
project_id string Yes Project ID
target_id string Yes API target ID
version number Yes Current version (optimistic concurrency)
name string No New name
method string No HTTP method
url string No Request URL
description string No Description
mark_id string No 1=in-progress, 2=done, 3=needs-revision
tags string No Comma-separated tags

apipost_delete_apis

Param Type Required Description
project_id string Yes Project ID
target_ids string Yes Comma-separated target IDs to delete

apipost_list_test_scenes

Param Type Required Description
project_id string Yes Project ID

apipost_list_test_reports

Param Type Required Description
project_id string Yes Project ID

Project Structure

apipost-mcp/
├── cmd/apipost-mcp/
│   └── main.go          # Entry point, server wiring
├── internal/
│   ├── client/
│   │   └── client.go    # APIPost HTTP client
│   ├── tools/
│   │   ├── tools.go     # Tool registration & user/team/project tools
│   │   ├── api_tools.go # API management tools
│   │   └── helpers.go   # Shared utilities
│   └── types/
│       └── types.go     # Request/response types
├── docs/
│   └── 开放接口(V8).md  # APIPost Open API reference
├── go.mod
└── go.sum

License

MIT License

相关 MCP 服务