MCPStudio: The Postman for Model Context Protocol

MCPStudio: The Postman for Model Context Protocol

For MCP (Minecraft Protocol) servers, using Postman directly isn't the typical workflow. The Minecraft protocol is a binary protocol, not a standard HTTP protocol that Postman is designed for. Postman excels at sending and receiving HTTP requests and displaying JSON, XML, or other text-based responses. However, you can use Postman in conjunction with a custom script or proxy to interact with an MCP server. Here's a breakdown of the approaches and considerations: **Why Postman Isn't Directly Compatible:** * **Binary Protocol:** The Minecraft protocol uses a custom binary format for communication. Postman is designed for text-based protocols like HTTP. * **Authentication:** Minecraft authentication is handled differently than standard web authentication. * **Stateful Connection:** Minecraft connections are typically stateful, maintaining a persistent connection between the client and server. Postman is designed for stateless requests. **Possible Approaches (with varying levels of complexity):** 1. **Custom Script/Proxy:** This is the most common and flexible approach. * **Concept:** You create a script (e.g., in Python, Node.js, Java) that acts as a proxy. This script: * Listens for HTTP requests from Postman. * Translates those HTTP requests into the appropriate Minecraft protocol packets. * Sends the packets to the MCP server. * Receives responses from the MCP server. * Translates the responses back into a format Postman can understand (e.g., JSON). * Sends the JSON response back to Postman. * **Example (Conceptual Python using `mcstatus` library):** ```python from flask import Flask, request, jsonify from mcstatus import JavaServer app = Flask(__name__) @app.route('/minecraft/status', methods=['GET']) def get_minecraft_status(): server_address = request.args.get('address', 'localhost:25565') # Get server address from Postman try: server = JavaServer.lookup(server_address) status = server.status() return jsonify({ "online": True, "players_online": status.players.online, "players_max": status.players.max, "version": status.version.name, "motd": status.description }) except Exception as e: return jsonify({"online": False, "error": str(e)}) if __name__ == '__main__': app.run(debug=True, port=5000) ``` * **Explanation:** * This Python code uses Flask to create a simple web server. * It uses the `mcstatus` library to query a Minecraft server. * The `/minecraft/status` endpoint accepts a server address as a query parameter. * It returns a JSON response with the server status. * **Postman Setup:** * In Postman, you would send a GET request to `http://localhost:5000/minecraft/status?address=yourserver.com:25565`. * Postman would display the JSON response from the Python script. * **Libraries:** * **Python:** `mcstatus`, `nbt`, `pymclevel` (for level data) * **Node.js:** `minecraft-protocol`, `prismarine-nbt` * **Java:** `minecraft-server-util` (for status pings), custom packet handling * **Pros:** Most flexible, allows you to implement any Minecraft protocol interaction. * **Cons:** Requires significant programming effort. You need to understand the Minecraft protocol. 2. **Pre-built Minecraft API (if available):** * Some Minecraft server implementations (e.g., some modded servers) might expose a REST API. If so, you can use Postman to interact with that API directly. * **Check the server documentation** to see if an API exists. * **Pros:** Easiest if an API is available. * **Cons:** Relies on the server providing an API, which is not standard. 3. **Wireshark (for Packet Analysis):** * While not directly using Postman, you can use Wireshark to capture and analyze the raw Minecraft protocol packets being sent between a Minecraft client and server. * This is useful for understanding the protocol and debugging your own implementations. * **Pros:** Excellent for understanding the protocol. * **Cons:** Doesn't allow you to send custom packets. **Important Considerations:** * **Minecraft Protocol Version:** The Minecraft protocol changes with each version of Minecraft. Make sure your script or library supports the correct version. * **Authentication:** You'll need to handle Minecraft authentication if you want to interact with a server that requires it. This typically involves using the Mojang authentication API. * **Server Security:** Be careful when sending custom packets to a Minecraft server. Malicious packets could potentially crash the server or cause other problems. * **Rate Limiting:** Some servers may have rate limits to prevent abuse. Be mindful of these limits when sending requests. **In summary:** Postman is not a direct tool for interacting with Minecraft servers due to the binary protocol. You'll need to use a custom script or proxy to translate between HTTP requests (from Postman) and the Minecraft protocol. The `mcstatus` library (in Python) provides a simple example for getting server status. For more complex interactions, you'll need to delve deeper into the Minecraft protocol and use more advanced libraries. If the server provides a REST API, that's the easiest way to interact with it using Postman. --- **Chinese Translation (Summary):** 由于 Minecraft 服务器使用二进制协议,Postman 无法直接与之交互。你需要使用自定义脚本或代理来在 HTTP 请求(来自 Postman)和 Minecraft 协议之间进行转换。`mcstatus` 库(在 Python 中)提供了一个获取服务器状态的简单示例。对于更复杂的交互,你需要深入研究 Minecraft 协议并使用更高级的库。如果服务器提供了 REST API,那是使用 Postman 与之交互的最简单方法。 (Simplified Chinese) 由于 Minecraft 服务器使用二进制协议,Postman 无法直接与之交互。你需要使用自定义脚本或代理来在 HTTP 请求(来自 Postman)和 Minecraft 协议之间进行转换。`mcstatus` 库(在 Python 中)提供了一个获取服务器状态的简单示例。对于更复杂的交互,你需要深入研究 Minecraft 协议并使用更高级的库。如果服务器提供了 REST API,那是使用 Postman 与之交互的最简单方法。

lonexreb

研究与数据
访问服务器

README

MCPStudio:模型上下文协议的 Postman

简介

MCPStudio 是一个强大且用户友好的平台,旨在创建、测试、管理和发现模型上下文协议 (MCP) 服务器。 类似于 Postman 如何彻底改变 API 开发和测试一样,MCPStudio 提供了一个直观的可视化界面,用于与 MCP 服务器交互,从而抽象化了协议底层复杂的技术细节。

什么是模型上下文协议 (MCP)?

模型上下文协议是一种标准,它使 AI 系统(如大型语言模型)能够与外部工具、数据源和服务无缝连接。 MCPStudio 通过可视化、用户友好的界面,使技术和非技术用户都能轻松访问此集成过程。

核心架构

MCPStudio 遵循清晰的领域驱动设计,包含:

后端 (Python/FastAPI)

  • 以分层方式组织:API、应用、领域和基础设施
  • 使用依赖注入(通过 container.py 文件)
  • 实现可以连接到各种外部工具的 MCP 协议服务
  • 具有 MongoDB 集成以实现持久性
  • 提供用于服务器和工具管理的 RESTful API

前端 (React)

  • 具有用于服务器、工具和配置的组件的现代 UI
  • 交互式工具测试界面
  • 服务器部署和管理
  • 用于监控服务器状态的仪表板

主要特性

服务器管理

  • 通过直观的 UI 创建和配置 MCP 服务器
  • 实时监控服务器状态和健康状况(已部署、正在部署、失败)
  • 使用标签和集合组织服务器
  • 查看服务器详细信息和配置
  • 用于服务器 CRUD 操作的 RESTful API 端点

工具发现和测试

  • 以可视化方式浏览 MCP 服务器公开的工具
  • 使用参数驱动的界面测试工具
  • 查看带有语法高亮显示的格式化响应
  • 保存工具执行以供将来参考

身份验证管理

  • OAuth 流支持服务集成
  • 安全的凭据存储
  • 自动令牌刷新处理
  • 基于 JWT 的平台自身身份验证

Google Drive 集成

  • 通过 OAuth 连接到 Google Drive
  • 列出和浏览文件
  • 搜索内容
  • 检索文件内容
  • 创建文件夹

实时协作

  • 与团队成员共享服务器和工具
  • 协作进行工具测试
  • 查看执行历史记录

实现状态

阶段 1:后端基础设施(已完成)

  • ✅ 用于服务器和工具的 MongoDB 存储库实现
  • ✅ 用于通过 WebSockets 进行实时更新的事件总线
  • ✅ 具有 OAuth 集成的 JWT 身份验证系统
  • ✅ 具有 OAuth 流的 Google Drive 集成
  • ✅ 核心功能的单元测试
  • ✅ 用于服务器管理的 RESTful API 端点
  • ✅ 具有 CRUD 操作的服务器控制器

阶段 2:前端开发(进行中)

  • 具有现代工具链的 React 前端
  • 服务器连接管理面板
  • 工具发现和浏览界面
  • 用于工具执行的参数输入表单
  • 响应可视化组件
  • 具有 OAuth 流集成的身份验证 UI

阶段 3:端到端集成(计划中)

  • 前端中的 API 客户端
  • 用于实时更新的 WebSocket 连接
  • 一致的错误处理

阶段 4:其他 MCP 集成(计划中)

  • GitHub 作为第二个集成
  • 用于新集成的模板系统

工作原理

  1. 用户可以通过 UI 创建和配置 MCP 服务器
  2. MCPStudio 使用 MCP 协议连接到这些服务器
  3. 它发现可用的工具,并在用户友好的界面中呈现它们
  4. 用户可以使用不同的参数测试工具并查看响应
  5. 可以部署服务器并监控其状态

技术栈

后端

  • 语言: Python 3.10+
  • 框架: FastAPI
  • 数据库: MongoDB
  • 包管理: UV (超快速 Python 包管理器)
  • 身份验证: JWT + OAuth2
  • 实时通信: WebSockets

前端

  • 框架: React
  • 状态管理: Redux
  • UI 组件: Tailwind CSS
  • API 通信: Axios

项目结构

MCPstudio/
├── backend/                  # 后端应用程序
│   └── mcp_studio_backend/   # Python 包
│       ├── src/              # 源代码
│       │   └── mcp_studio/   # 主模块
│       └── tests/            # 测试套件
└── frontend/                 # 前端应用程序
    └── ai-server-forge/      # React 应用程序
        ├── src/              # 源代码
        │   ├── components/   # React 组件
        │   ├── hooks/        # 自定义 React hooks
        │   ├── lib/          # 实用程序函数
        │   ├── pages/        # 页面组件
        │   └── types/        # TypeScript 类型定义
        └── public/           # 静态资源

快速入门

前提条件

  • Python 3.10+
  • Node.js 16+
  • MongoDB
  • UV 包管理器(可选,但推荐)

安装

  1. 克隆存储库

    git clone https://github.com/lonexreb/mcpstudio.git
    cd mcpstudio
    
  2. 设置后端

    cd backend/mcp_studio_backend
    python -m venv venv
    source venv/bin/activate  # 在 Windows 上:venv\Scripts\activate
    pip install uv
    uv pip install -e .
    
  3. 设置前端

    cd ../../frontend/ai-server-forge
    npm install
    
  4. 启动开发服务器

    后端:

    cd ../../backend/mcp_studio_backend
    uvicorn mcp_studio.main:app --reload
    

    前端:

    cd ../../frontend/ai-server-forge
    npm run dev
    
  5. 打开浏览器并导航到 http://localhost:3000

API 端点

服务器管理

  • POST /api/servers - 创建新服务器
  • GET /api/servers - 列出所有服务器
  • GET /api/servers/{server_id} - 获取服务器详细信息
  • PUT /api/servers/{server_id} - 更新服务器
  • DELETE /api/servers/{server_id} - 删除服务器
  • POST /api/servers/{server_id}/connect - 连接到服务器
  • POST /api/servers/{server_id}/disconnect - 断开与服务器的连接

工具管理

  • GET /api/servers/{server_id}/tools - 列出服务器的工具
  • GET /api/tools/{tool_id} - 获取工具详细信息
  • POST /api/servers/{server_id}/tools/{tool_id}/execute - 执行工具

身份验证

  • POST /api/auth/token - 获取 JWT 访问令牌
  • GET /api/auth/google/auth - 获取 Google OAuth URL
  • GET /api/auth/google/callback - 处理 Google OAuth 回调
  • GET /api/auth/me - 获取当前用户信息

贡献

欢迎贡献! 请随时提交 Pull Request。

许可证

此项目已获得 MIT 许可证的许可 - 有关详细信息,请参阅 LICENSE 文件。

推荐服务器

Crypto Price & Market Analysis MCP Server

Crypto Price & Market Analysis MCP Server

一个模型上下文协议 (MCP) 服务器,它使用 CoinCap API 提供全面的加密货币分析。该服务器通过一个易于使用的界面提供实时价格数据、市场分析和历史趋势。 (Alternative, slightly more formal and technical translation): 一个模型上下文协议 (MCP) 服务器,利用 CoinCap API 提供全面的加密货币分析服务。该服务器通过用户友好的界面,提供实时价格数据、市场分析以及历史趋势数据。

精选
TypeScript
MCP PubMed Search

MCP PubMed Search

用于搜索 PubMed 的服务器(PubMed 是一个免费的在线数据库,用户可以在其中搜索生物医学和生命科学文献)。 我是在 MCP 发布当天创建的,但当时正在度假。 我看到有人在您的数据库中发布了类似的服务器,但还是决定发布我的服务器。

精选
Python
mixpanel

mixpanel

连接到您的 Mixpanel 数据。 从 Mixpanel 分析查询事件、留存和漏斗数据。

精选
TypeScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

这个服务器通过将复杂问题分解为顺序步骤来促进结构化的问题解决,支持修订,并通过完整的 MCP 集成来实现多条解决方案路径。

精选
Python
Nefino MCP Server

Nefino MCP Server

为大型语言模型提供访问德国可再生能源项目新闻和信息的能力,允许按地点、主题(太阳能、风能、氢能)和日期范围进行筛选。

官方
Python
Vectorize

Vectorize

将 MCP 服务器向量化以实现高级检索、私有深度研究、Anything-to-Markdown 文件提取和文本分块。

官方
JavaScript
Mathematica Documentation MCP server

Mathematica Documentation MCP server

一个服务器,通过 FastMCP 提供对 Mathematica 文档的访问,使用户能够从 Wolfram Mathematica 检索函数文档和列出软件包符号。

本地
Python
kb-mcp-server

kb-mcp-server

一个 MCP 服务器,旨在实现便携性、本地化、简易性和便利性,以支持对 txtai “all in one” 嵌入数据库进行基于语义/图的检索。任何 tar.gz 格式的 txtai 嵌入数据库都可以被加载。

本地
Python
Research MCP Server

Research MCP Server

这个服务器用作 MCP 服务器,与 Notion 交互以检索和创建调查数据,并与 Claude Desktop Client 集成以进行和审查调查。

本地
Python
Cryo MCP Server

Cryo MCP Server

一个API服务器,实现了模型补全协议(MCP),用于Cryo区块链数据提取,允许用户通过任何兼容MCP的客户端查询以太坊区块链数据。

本地
Python