Bloomy MCP

Bloomy MCP

一个模型上下文协议服务器,用于将 AI 助手连接到 Bloom Growth 的 GraphQL API,使它们能够查询数据并对 Bloom Growth 平台执行操作。

数据库
开发者工具
Python
访问服务器

Tools

get_query_details

Get detailed information about specific GraphQL queries. Retrieves argument requirements, return type information, descriptions, and example usage for the specified queries. Args: query_names: Comma-separated list of query names to get details for Returns: A YAML-formatted string containing detailed information about the requested queries

get_mutation_details

Get detailed information about specific GraphQL mutations. Retrieves argument requirements, return type information, descriptions, and example usage for the specified mutations. Args: mutation_names: Comma-separated list of mutation names to get details for Returns: A YAML-formatted string containing detailed information about the requested mutations

execute_query

Execute a GraphQL query or mutation with variables. Parses and executes the provided GraphQL operation string with optional variables. Args: query: Raw GraphQL query or mutation string variables: Optional dictionary of variables to use in the operation Returns: Dictionary containing the operation results or an error message string Raises: Exception: Handled internally, returns error message as string

get_authenticated_user_id

Get the ID of the currently authenticated user. Uses a special mutation to retrieve the ID of the user associated with the current API token. Returns: User ID string if successful, None if user not found, or error message string Raises: Exception: Handled internally, returns error message as string

README

Bloomy MCP

一个用于与 Bloom Growth 的 GraphQL API 交互的模型上下文协议 (MCP) 服务器。

概述

Bloomy MCP 是一个连接到 Bloom Growth 的 GraphQL API 并通过模型上下文协议公开它的服务器,使 AI 助手能够对 Bloom Growth 平台执行操作。

特性

  • 通过 MCP 查询 Bloom Growth GraphQL API
  • 检索查询和变更详情
  • 通过 MCP 工具执行 GraphQL 查询和变更
  • 获取已验证的用户信息
  • 自动模式内省

安装

前提条件

  • Python 3.12 或更高版本
  • 访问 Bloom Growth API
  • uv (推荐) 或 pip 用于包管理

包管理

本项目推荐使用 uv,它是一个快速的 Python 包安装器和解析器,可以作为 pip/pip-tools 的替代品。它比传统的包管理器快得多。

安装 uv

curl -sSf https://astral.sh/uv/install.sh | sh

对于其他安装方法,请参阅 uv 文档

设置

  1. 克隆此存储库

  2. 设置 Python 虚拟环境:

    python -m venv .venv
    source .venv/bin/activate  # 在 Windows 上:.venv\Scripts\activate
    
  3. 以开发模式安装软件包:

    使用 pip:

    pip install -e .
    

    使用 uv (推荐):

    uv pip install -e .
    

    对于开发依赖项:

    uv pip install -e ".[dev]"
    

环境变量

创建一个包含以下变量的 .env 文件:

BLOOM_API_URL=<您的 Bloom API URL>
BLOOM_API_TOKEN=<您的 Bloom API Token>

用法

Cursor 集成

要将此 MCP 服务器与 Cursor (AI 驱动的 IDE) 一起使用:

  1. 转到 Cursor > Cursor 设置 > MCP

  2. 单击“添加新的 MCP 服务器”

  3. 使用以下详细信息配置服务器:

    • 名称:“Bloom Growth”(或“BG”或您喜欢的任何名称)
    • 类型:命令
    • 命令:uv run --project /path/to/your/repo/ --env-file /path/to/your/repo/.env bloomy-server

    重要提示:将 /path/to/your/repo/ 替换为 bloomy-mcp 存储库的实际路径(例如,/Users/username/workspace/bloomy-mcp/)。

运行服务器

启动 Bloomy MCP 服务器:

bloomy-server

开发模式检查

为了开发和调试目的,您可以使用 MCP 检查器工具:

npx @modelcontextprotocol/inspector bloomy-server

这允许您在开发期间检查 MCP 服务器的行为和响应。

推荐工具

为了获得最佳的开发工作流程:

  • direnv:用于管理环境变量并在进入项目目录时自动加载它们
  • uv:用于快速可靠的包管理

设置 direnv:

  1. 安装 direnv(例如,macOS 上为 brew install direnv
  2. 在项目根目录中创建一个 .envrc 文件:
    export BLOOM_API_URL=your_api_url
    export BLOOM_API_TOKEN=your_api_token
    
  3. 运行 direnv allow 以授权环境变量

这种工具组合 (direnv + uv) 为秘密管理和包管理提供了高效的环境。

可用的 MCP 工具

以下 MCP 工具可供 AI 助手使用:

  • get_query_details - 获取有关特定 GraphQL 查询的详细信息
  • get_mutation_details - 获取有关特定 GraphQL 变更的详细信息
  • execute_query - 使用变量执行 GraphQL 查询或变更
  • get_authenticated_user_id - 获取当前已验证用户的 ID

可用的 MCP 资源

  • bloom://queries - 获取所有可用查询的列表
  • bloom://mutations - 获取所有可用变更的列表

开发

项目结构

src/
  └── bloomy_mcp/
      ├── __init__.py        # 包初始化
      ├── client.py          # GraphQL 客户端实现
      ├── formatters.py      # 数据格式化实用程序
      ├── introspection.py   # GraphQL 模式内省
      ├── operations.py      # GraphQL 操作实用程序
      └── server.py          # MCP 服务器实现

依赖项

  • mcp[cli] - 模型上下文协议服务器
  • gql - GraphQL 客户端库
  • httpx - HTTP 客户端
  • pyyaml - YAML 处理

推荐服务器

Playwright MCP Server

Playwright MCP Server

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

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

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

官方
精选
本地
TypeScript
MCP Package Docs Server

MCP Package Docs Server

促进大型语言模型高效访问和获取 Go、Python 和 NPM 包的结构化文档,通过多语言支持和性能优化来增强软件开发。

精选
本地
TypeScript
Claude Code MCP

Claude Code MCP

一个实现了 Claude Code 作为模型上下文协议(Model Context Protocol, MCP)服务器的方案,它可以通过标准化的 MCP 接口来使用 Claude 的软件工程能力(代码生成、编辑、审查和文件操作)。

精选
本地
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

用于任务管理的模型上下文协议服务器。它允许 Claude Desktop(或任何 MCP 客户端)在基于队列的系统中管理和执行任务。

精选
本地
JavaScript
DuckDuckGo MCP Server

DuckDuckGo MCP Server

一个模型上下文协议 (MCP) 服务器,通过 DuckDuckGo 提供网页搜索功能,并具有内容获取和解析的附加功能。

精选
Python
Supabase MCP Server

Supabase MCP Server

一个模型上下文协议(MCP)服务器,它提供对 Supabase 管理 API 的编程访问。该服务器允许 AI 模型和其他客户端通过标准化的接口来管理 Supabase 项目和组织。

精选
JavaScript
YouTube Transcript MCP Server

YouTube Transcript MCP Server

这个服务器用于获取指定 YouTube 视频 URL 的字幕,从而可以与 Goose CLI 或 Goose Desktop 集成,进行字幕提取和处理。

精选
Python
mermaid-mcp-server

mermaid-mcp-server

一个模型上下文协议 (MCP) 服务器,用于将 Mermaid 图表转换为 PNG 图像。

精选
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP 服务器向 AI 编码助手(如 Cursor)提供 Jira 工单信息。

精选
TypeScript