Azure 表存储 MCP 服务器是一个基于 TypeScript 的工具,它支持直接通过 Cline 与 Azure 表存储交互,能够让您轻松查询和管理 Azure 存储表中的数据。
要使用 Azure 表存储 MCP 服务器,您可以按照以下步骤进行安装和配置。
git clone https://github.com/dkmaker/mcp-azure-tablestorage.git
cd mcp-azure-tablestorage
npm install
npm run build
您可以通过 npm 全局安装该包:
npm install -g dkmaker-mcp-server-tablestore
或者直接使用 npx 运行:
npx dkmaker-mcp-server-tablestore
⚠️ 重要提示
当使用 npx 或全局安装时,仍然需要配置 AZURE_STORAGE_CONNECTION_STRING 环境变量。
要在 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 许可证,允许您自由使用、修改和分发代码,只要在衍生作品中包含原始版权声明和许可条款。