ApiPost MCP

ApiPost MCP

A server that enables management of ApiPost API documentation and team collaboration through the Model Context Protocol, supporting complete interface management directly from compatible editors.

Category
Visit Server

README

🚀 ApiPost MCP

基于 MCP (Model Context Protocol) 协议的 ApiPost API 管理工具,支持完整的接口文档管理和团队协作。兼容所有支持 MCP 协议的编辑器。

✨ 功能特性

  • 📋 完整接口管理:创建、修改、删除HTTP接口,支持完整参数配置
  • 📁 目录结构管理:创建和管理目录层级,支持父子级结构
  • 🔍 智能搜索:URL优先匹配,支持名称和关键词搜索
  • 👥 团队协作:支持多团队、多项目管理
  • 🛡️ 安全模式:可配置安全级别,防止误操作
  • 🎯 智能识别:自动识别接口类型,支持多种认证方式

🔧 安装配置

环境要求

  • Node.js 16+
  • 支持 MCP 协议的编辑器(如 Cursor、VS Code 等)
  • ApiPost 账号和项目访问权限

快速安装

# 克隆项目
git clone <repository-url>
cd apipost-mcp

# 安装依赖并构建
npm install
npm run build

MCP 配置

在编辑器的 MCP 配置文件中添加配置(如 Cursor 的 ~/.cursor/mcp.json 或 VS Code 的相应配置文件):

{
  "mcpServers": {
    "apipost": {
      "command": "node",
      "args": ["/absolute/path/to/apipost-mcp/dist/index.js"],
      "env": {
        "APIPOST_TOKEN": "your_access_token_here",
        "APIPOST_HOST": "https://open.apipost.net",
        "APIPOST_SECURITY_MODE": "safe",
        "APIPOST_DEFAULT_TEAM_NAME": "我的团队",
        "APIPOST_DEFAULT_PROJECT_NAME": "我的项目"
      }
    }
  }
}

🚀 使用指南

基本操作

  1. 查看项目概览

    查看项目的所有接口和目录
    
  2. 搜索接口

    搜索包含 "user" 的接口
    
  3. 创建接口

    创建 POST 接口 "/api/user/login" 名称为 "用户登录"
    
  4. 更新接口

    修改接口 "/api/user/login" 的描述为 "用户登录接口"
    

工作空间配置

🚀 推荐方式:直接配置名称

名称配置(最简单)

"env": {
  "APIPOST_TOKEN": "your_access_token_here",
  "APIPOST_DEFAULT_TEAM_NAME": "我的团队",
  "APIPOST_DEFAULT_PROJECT_NAME": "我的项目"
}

最简配置 + 动态设置

"env": {
  "APIPOST_TOKEN": "your_access_token_here"
}

然后使用工具设置工作空间:

设置工作空间:
- 团队名称:我的团队
- 项目名称:我的项目

安全模式说明

🟢 Safe 模式(默认推荐)

  • ✅ 查看、创建、修改接口
  • ❌ 禁止删除操作
  • 🎯 适用:日常开发使用

🔴 Full 模式

  • ✅ 所有操作(包括删除)
  • ⚠️ 警告:谨慎使用,有删除风险

📋 可用工具

工具名称 功能描述 主要参数
apipost_list_all 查看项目总览 search(可选), show_details(可选)
apipost_search_apis 搜索接口 keyword(必需)
apipost_create 创建接口/目录 type, name, method(接口), url(接口)
apipost_update 更新接口/目录 identifier(必需), new_name(可选)
apipost_batch_delete 批量删除 target_ids(必需)
apipost_list_teams 查看团队列表 -
apipost_list_projects 查看项目列表 team_id(可选)
apipost_get_api_details 获取接口详情 target_ids(必需)
apipost_set_workspace 设置工作空间 team_name(可选), project_name(可选)

⚙️ 配置参数

必需环境变量

变量名 说明 示例
APIPOST_TOKEN API访问令牌 apk_xxxxxxxxx

可选环境变量

变量名 默认值 说明
APIPOST_HOST https://open.apipost.net API服务地址
APIPOST_SECURITY_MODE safe 安全模式(safe/full)
APIPOST_DEFAULT_TEAM_NAME - 默认团队名称
APIPOST_DEFAULT_PROJECT_NAME - 默认项目名称

🔑 获取配置信息

获取 API Token

  1. 登录 ApiPost
  2. 点击右上角头像 → 个人设置
  3. 左侧菜单选择 开放接口
  4. 复制 访问令牌(格式:apk_xxxxxxxxxxxx

获取项目信息

  1. 进入要管理的 ApiPost 项目
  2. 可以直接使用项目名称,支持模糊匹配
  3. 或者从项目设置中获取具体的项目ID

🔍 故障排除

常见问题

Q: "请设置 APIPOST_TOKEN" 错误?

A: 检查以下项目:
   1. 确认令牌格式为 apk_xxxxxxxxx
   2. 重新从 ApiPost 个人设置复制令牌
   3. 检查 mcp.json 配置文件格式

Q: "获取项目数据失败" 错误?

A: 确保配置正确:
   1. 检查网络连接
   2. 确认令牌对应的账号有项目访问权限
   3. 验证团队名称和项目名称是否正确

Q: MCP 工具不可用?

A: 配置检查:
   1. 确认 MCP 配置文件格式正确(JSON语法)
   2. 使用绝对路径指向 dist/index.js
   3. 确认项目已正确构建(npm run build)
   4. 重启编辑器

🧪 开发测试

# 手动测试服务器
cd apipost-mcp
export APIPOST_TOKEN="your_token"
node dist/index.js

# 重新构建
npm run build

# 检查构建结果
ls dist/

📖 详细文档

🚀 项目特色

💡 技术优势

  • 🎯 TypeScript开发:类型安全,开发体验优秀
  • 🔧 模块化设计:清晰的代码结构,易于维护
  • 🛡️ 完善错误处理:用户友好的错误信息
  • ⚡ 智能缓存:性能优化,快速响应

🎮 用户体验

  • 🌳 直观展示:树形结构,项目一目了然
  • 🔍 智能匹配:URL优先匹配,减少操作错误
  • 📝 完整配置:支持所有API参数类型
  • 🚀 高效操作:一条命令完成复杂配置

💡 提示:使用过程中遇到问题,请检查 ApiPost 个人设置中的 API Token 是否正确配置。

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured