Mcp Azure Tablestorage

Mcp Azure Tablestorage

🚀 Azure 表存储 MCP 服务器

Azure 表存储 MCP 服务器是一个基于 TypeScript 的工具,它支持直接通过 Cline 与 Azure 表存储交互,能够让您轻松查询和管理 Azure 存储表中的数据。

🚀 快速开始

要使用 Azure 表存储 MCP 服务器,您可以按照以下步骤进行安装和配置。

✨ 主要特性

  • 使用 OData 过滤器支持查询 Azure 存储表。
  • 获取表架构以了解数据结构。
  • 列出存储账户中的所有表。
  • 详细的错误处理和响应信息。
  • 简单的连接字符串配置。

📦 安装指南

本地开发环境搭建

  1. 克隆仓库:
git clone https://github.com/dkmaker/mcp-azure-tablestorage.git
cd mcp-azure-tablestorage
  1. 安装依赖项:
npm install
  1. 构建服务器:
npm run build

NPM 安装

您可以通过 npm 全局安装该包:

npm install -g dkmaker-mcp-server-tablestore

或者直接使用 npx 运行:

npx dkmaker-mcp-server-tablestore

⚠️ 重要提示

当使用 npx 或全局安装时,仍然需要配置 AZURE_STORAGE_CONNECTION_STRING 环境变量。

在 Cline 中安装

要在 Cline 中使用 Azure 表存储服务器,请将其添加到 MCP 设置配置文件中。配置文件位于: Windows: %APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json 在配置文件中添加以下内容:

{
"mcpServers": {
"tablestore": {
"command": "node",
"args": ["C:/path/to/your/mcp-azure-tablestorage/build/index.js"],
"env": {
"AZURE_STORAGE_CONNECTION_STRING": "your_connection_string_here"  // 必填:您的 Azure 存储连接字符串
}
}
}
}

请将 C:/path/to/your/mcp-azure-tablestorage 替换为您实际克隆仓库的路径。

🔧 配置

该服务器需要以下环境变量:

  • AZURE_STORAGE_CONNECTION_STRING:您的 Azure 存储账户连接字符串

💻 使用示例

基础用法

⚠️ 重要安全提示:query_table 工具默认返回结果集的前 1,000 行。如需获取完整结果,请在查询中包含 $top=10000 参数。

# 查询 Users 表,其中 PartitionKey 等于 'ACTIVE'
clitable tablestore query "Users" --where "PartitionKey='ACTIVE'"

# 插入一条新记录到 Items 表
clitable tablestore insert "Items" --json '{"id": 1, "name": "Item 1"}'

# 更新 Items 表中的现有记录
clitable tablestore update "Items" --where "PartitionKey=1" --set "Name='NewItem'"

# 删除 Users 表中 PartitionKey 等于 'ARCHIVED' 的记录
clitable tablestore delete "Users" --where "PartitionKey='ARCHIVED'"

输出格式

所有命令的结果将以表格形式呈现,便于阅读和分析。

📚 详细文档

项目结构

src/
├── index.ts              # 主入口文件
├── commands/             # 包含各个操作的定义
│   ├── query.ts         # 查询表数据
│   ├── insert.ts        # 插入新记录
│   ├── update.ts        # 更新现有记录
│   └── delete.ts        # 删除记录
└── config.json          # 配置文件,包含连接字符串等信息

依赖项

{
"name": "mcp-azure-tablestorage",
"version": "1.0.0",
"dependencies": {
"@types/azure-storage": "^latest",
"cli-table": "^latest"
}
}

📄 许可证

本项目使用 MIT 许可证,允许您自由使用、修改和分发代码,只要在衍生作品中包含原始版权声明和许可条款。

  • 0 关注
  • 0 收藏,23 浏览
  • system 提出于 2025-10-05 06:36

相似服务问题

相关AI产品