Unleash Mcp

Unleash Mcp

一个与 Unleash Feature Toggle 系统集成的模型上下文协议 (MCP) 服务器实现。

cuongtl1992

开发者工具
访问服务器

Tools

getFlag

Get detailed information about a feature flag

createFlag

Create a new feature flag in an Unleash project

updateFlag

Update an existing feature flag in an Unleash project

patchFlag

Modify specific properties of an existing feature flag in an Unleash project using JSON Patch operations

addStrategy

Add a strategy to a feature flag in a specific environment

updateStrategy

Update a strategy configuration for a feature flag in the specified environment

deleteStrategy

Delete a strategy configuration from a feature flag in the specified environment

setStrategySortOrder

Set the sort order of strategies for a feature flag in a specific environment

getProjectFeatures

Get all features for a specific project from the Unleash repository

getProjectFeature

Get detailed information about a feature flag in a specific project

archiveFlag

Archive a feature flag in a specific project

validateFeatureName

Validate if a feature flag name is valid and available for use

getProjects

Get a list of all projects

listFlags

Get a list of all feature flags

getFeatureTypes

Get a list of all feature types with their descriptions and lifetimes

getEnvironments

Get a list of all environments configured in Unleash

getFeatureTags

Get a list of all tags for a specific feature

addFeatureTag

Add a tag to a feature flag

enableFlag

Enables a feature flag in the specified environment

disableFlag

Disables a feature flag in the specified environment

markFeaturesStale

Marks features as stale or not stale in the specified project

README

释放 MCP 服务器

一个模型上下文协议 (MCP) 服务器的实现,它与 Unleash Feature Toggle 系统集成。

概述

本项目提供了一个 LLM 应用和 Unleash 特性开关系统之间的桥梁,使用模型上下文协议 (MCP)。它允许 AI 应用:

  1. 从 Unleash 检查特性开关状态
  2. 向 LLM 公开特性开关信息
  3. 创建特性开关
  4. 更新特性开关
  5. 列出所有项目

目录

要求

  • Node.js (v18 或更高版本)
  • TypeScript (v5.0 或更高版本)
  • 访问 Unleash 服务器实例

安装

# 安装依赖
npm i

架构

Unleash MCP 服务器充当 LLM 应用和 Unleash 特性开关系统之间的桥梁:

+----------------+      +-------------------+      +----------------+
|                |      |                   |      |                |
|  LLM 应用       | <--> |  Unleash MCP      | <--> |  Unleash API   |
|  (MCP 客户端)  |      |  服务器           |      |  服务器        |
|                |      |                   |      |                |
+----------------+      +-------------------+      +----------------+

开发

项目结构

unleash-mcp-server/
├── src/
│   ├── index.ts              # 主入口点
│   ├── server.ts             # 服务器实现
│   ├── config.ts             # 配置处理
│   ├── transport/            # MCP 传输实现
│   │   ├── http.ts           # HTTP/SSE 传输
│   │   └── stdio.ts          # STDIO 传输
│   ├── unleash/              # Unleash API 客户端实现
│   │   ├── unleash-client.ts # 主要 Unleash 客户端
│   │   ├── get-feature-flag.ts
│   │   └── get-all-projects.ts
│   ├── resources/            # MCP 资源实现
│   │   ├── flags.ts          # 特性开关资源
│   │   └── projects.ts       # 项目资源
│   ├── tools/                # MCP 工具实现
│   │   ├── get-flag.ts       # 获取特性开关工具
│   │   └── get-projects.ts   # 获取项目工具
│   └── prompts/              # MCP 提示实现
│       ├── flag-check.ts     # 检查单个开关
│       └── batch-flag-check.ts # 检查多个开关
├── tests/                    # 测试
└── package.json              # 项目配置

编码规范

  • 命名约定:

    • 文件: 使用 kebab-case.ts (例如, feature-flag.ts)
    • 类: 使用 PascalCase (例如, UnleashClient)
    • 函数/方法: 使用 camelCase (例如, getFlagStatus)
    • 接口/类型: 使用 PascalCase (例如, FeatureFlagConfig)
  • 导入:

    • 导入本地文件时始终包含 .js 扩展名
    • 遵循导入顺序: Node.js 内置模块 → 外部依赖 → 本地导入
    • 使用命名导出而不是默认导出
  • 文档:

    • 对公共函数、类和接口使用 JSDoc 注释
    • 使用内联注释记录复杂逻辑

构建

# 编译 TypeScript
npm run build

# 运行服务器
npm start

测试

# 运行测试
npm test

检查

# MCP stdio 检查
npm run build
npx @modelcontextprotocol/inspector node dist/index.js

# MCP sse 检查
npm start
npx @modelcontextprotocol/inspector

如何使用

对于 Claude 或 Cursor 配置:

{
  "mcpServers": {
    "unleash": {
      "command": "npx",
      "args": [
        "-y",
        "unleash-mcp"
      ],
      "env": {
        "UNLEASH_URL": "YOUR_UNLEASH_END_POINT",
        "UNLEASH_API_TOKEN": "YOUR_UNLEASH_API_TOKEN",
        "MCP_TRANSPORT": "stdio",
        "MCP_HTTP_PORT": 3001
      }
    }
  }
}

贡献

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

支持项目

如果您觉得这个项目有帮助,请考虑请我喝杯咖啡!

<p align="center"> <img src="https://raw.githubusercontent.com/cuongtl1992/mcp-dbs/main/assets/bmc_qr.png" alt="Buy Me A Coffee QR Code" width="200"> </p>

扫描上面的二维码或点击这里来支持这个项目的开发。

许可

本项目基于 MIT 许可 - 详情请查看 LICENSE 文件。

推荐服务器

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
mermaid-mcp-server

mermaid-mcp-server

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

精选
JavaScript
Jira-Context-MCP

Jira-Context-MCP

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

精选
TypeScript
Linear MCP Server

Linear MCP Server

一个模型上下文协议(Model Context Protocol)服务器,它与 Linear 的问题跟踪系统集成,允许大型语言模型(LLM)通过自然语言交互来创建、更新、搜索和评论 Linear 问题。

精选
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

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

精选
Python
Curri MCP Server

Curri MCP Server

通过管理文本笔记、提供笔记创建工具以及使用结构化提示生成摘要,从而实现与 Curri API 的交互。

官方
本地
JavaScript