Token导航 LogoToken导航TokenDH.com
GCC MCP Pilot logo
运维云端未说明官方级别未说明来源级核验

GCC MCP Pilot

MCP Server

通过MCP协议提供格洛斯特郡7个议会的民主数据访问服务,支持多议会数据查询和验证。

工具数

8

提示词数

0

GitHub Stars

0

资源数

0
JavaScriptClaude数据验证Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Gloucester-City-Council

提供方

Gloucester-City-Council

最后核验

2026/5/17 20:19

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

格洛斯特郡议会MCP服务器

Azure Functions v4 MCP(模型上下文协议)服务器,用于通过其ModernGov SOAP API访问来自格洛斯特郡所有7个议会的民主数据。

当前状态

组件状态注释
MCP协议实施✅ 完成initialize, tools/list, tools/call
多委员会支持✅ 完成格洛斯特郡所有7个议会
已定义工具架构✅ 完整的8个工具,具有完整的JSON模式和枚举验证
刀具布线✅ 完成端到端流程工作
理事会发现✅ 完成list_available_councils 工具
ModernGov SOAP客户端✅ 完整多端点支持,可回退到知识库
知识库✅ 完成所有议会的117个委员会,295个选区

支持的议会(7)

理事会委员会病房URL
格洛斯特郡议会3255https://glostext.gloucestershire.gov.uk
格洛斯特市议会1539https://democracy.gloucester.gov.uk
图克斯伯里自治市议会1538https://minutes.tewkesbury.gov.uk
斯特劳德区议会1051https://stroud.moderngov.co.uk
切尔滕纳姆自治市议会1840https://democracy.cheltenham.gov.uk
科茨沃尔德区议会1834https://meetings.cotswold.gov.uk
迪恩区议会森林938https://meetings.fdean.gov.uk

docs/COUNCIL_identifier.md 获取API调用中所需的确切理事会名称字符串。

项目结构

GCC-MCP-Pilot/
├── package.json
├── host.json
├── src/
│   ├── index.js                    # Azure Functions entry point
│   └── functions/
│       ├── mcp.js                  # Main MCP HTTP endpoint
│       └── test-soap.js            # SOAP exploration endpoint
├── lib/
│   ├── mcp-handler.js              # MCP JSON-RPC protocol handler
│   ├── moderngov-client.js         # SOAP client with multi-council support
│   ├── council-config.js           # Council configuration loader
│   └── tools/
│       ├── list-committees.js
│       ├── get-councillors.js
│       ├── get-councillors-by-ward.js
│       ├── get-meetings.js
│       ├── get-meeting-details.js
│       ├── get-attachment.js
│       └── analyze-meeting-document.js
├── json/
│   └── Gloucestershire/
│       ├── councils.json           # Council endpoints
│       └── council_data/
│           ├── Gloucester_City_Council/
│           │   ├── committees.json
│           │   └── wards.json
│           ├── Tewkesbury_Borough_Council/
│           │   ├── committees.json
│           │   └── wards.json
│           └── ... (5 more councils)
└── docs/
    ├── COUNCIL_IDENTIFIERS.md      # Council reference guide
    └── DEMOCRATIC_DATA_INTEGRITY.md

可用的MCP工具

工具参数说明
list_available_councils没有从这里开始! 列出所有7个带有元数据的议会
list_committeescouncil_name (可选)列出一个或所有理事会的委员会
get_councillorscouncil_name (必填)让所有议员按选区参加议会
get_councillors_by_wardcouncil_name, ward_name为特定选区寻找议员
get_meetingscouncil_name, committee_id召开委员会会议
get_meeting_detailscouncil_name, meeting_id获取详细的会议信息
get_attachmentcouncil_name, attachment_id获取文档元数据和URL
analyze_meeting_documenturl从PDF中提取结构化内容

必需参数

重要:大多数工具需要 council_name 带a的参数 精确区分大小写的匹配:

✅ 对的: "Gloucester City Council" ❌ 错误: "gloucester city council" (案例不匹配) ❌ 错误: "Gloucester Council" (缺少“城市”) ❌ 错误: "GCC" (缩写)

使用 list_available_councils 第一 获取确切的议会名称!

民主数据完整性

重要: 此MCP服务器返回民主决策的官方法定记录。使用这些数据的AI助手必须遵循特殊的处理规则:

  • 逐字引用:必须准确引用委员会的建议、决定、决议和动议
  • 始终链接源:包括 source_urlweb_page 来自响应的链接
  • 单独解释:明确区分官方记录和解释

docs/DEMOCRATIC_DATA_INTEGRITY.md 完整的指南。

数据分类字段

工具响应包括用于识别官方内容的元数据:

{
  "data_classification": "official_record",
  "is_official_record": true,
  "official_sections": ["recommendations", "decisions", "legal_implications"],
  "source": {
    "system": "ModernGov",
    "council": "Gloucester City Council",
    "url": "https://democracy.gloucester.gov.uk/..."
  }
}

文档/注释_BLOB_CLIENT_PERFORMANCE.md blob客户端重用和延迟指南 mcp-notes.

本地开发

先决条件

  • Node.js 18+
  • Azure功能核心工具v4

设置

cd GCC-MCP-Pilot
npm install

启动服务器

func start

服务器将在以下时间启动 http://localhost:7071

测试

测试MCP协议

# Test initialize - check server info and available councils
curl -X POST http://localhost:7071/api/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"initialize","params":{},"id":1}'

# Test tools/list - see all available tools
curl -X POST http://localhost:7071/api/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/list","id":2}'

# Test list_available_councils - discover councils
curl -X POST http://localhost:7071/api/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"list_available_councils","arguments":{}},"id":3}'

# Test list_committees - get committees for a specific council
curl -X POST http://localhost:7071/api/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"list_committees","arguments":{"council_name":"Gloucester City Council"}},"id":4}'

# Test list_committees - get all councils' committees
curl -X POST http://localhost:7071/api/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"list_committees","arguments":{}},"id":5}'

# Test get_councillors
curl -X POST http://localhost:7071/api/mcp \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"get_councillors","arguments":{"council_name":"Gloucester City Council"}},"id":6}'

探索SOAP响应

使用test-soap端点查看来自ModernGov的实际XML响应:

# List available operations
curl http://localhost:7071/api/test-soap

# Test GetCommittees
curl http://localhost:7071/api/test-soap/GetCommittees

# Test GetCouncillorsByWard
curl http://localhost:7071/api/test-soap/GetCouncillorsByWard

# Test GetMeetings with committee ID
curl "http://localhost:7071/api/test-soap/GetMeetings?committeeId=544"

# Test GetMeeting with meeting ID
curl "http://localhost:7071/api/test-soap/GetMeeting?meetingId=123456"

故障排除

“未从ChatGPT/Claude获取任何信息”

如果您看到诸如“未获取任何信息”之类的错误,请检查:

  1. 议会名称参数:确保精确区分大小写的匹配
   # Check available councils first
   curl -X POST http://localhost:7071/api/mcp \
     -H "Content-Type: application/json" \
     -d '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"list_available_councils","arguments":{}},"id":1}'
  1. 工具响应格式:工具返回以MCP内容格式包装的JSON:
   {
     "result": {
       "content": [{
         "type": "text",
         "text": "{ ...actual data... }"
       }]
     }
   }
  1. 错误响应:错误也以内容格式包装 isError: true:
   {
     "result": {
       "content": [{
         "type": "text",
         "text": "{\"error\": \"council_name is required\"}"
       }],
       "isError": true
     }
   }
  1. 检查服务器日志:Azure Functions日志显示所有工具调用和错误:
   # In local development
   func start
   # Watch the console output when making requests
  1. 手动测试:使用上面的curl命令验证工具是否正常工作

常见错误

错误原因解决方案
council_name is required缺少参数添加 council_name 参数
Unknown council: ...无效的议会名称使用 list_available_councils 获取确切的姓名
Ward not found病房名称无效使用 get_councillors 查看可用病房
SOAP request failed: 403网络限制正常-回退到知识库数据

调试步骤

  1. 测试工具/清单 验证MCP服务器是否正在响应
  2. 测试列表_可用_委员会 验证加载的议会配置
  3. 测试列表_提交 有专门的委员会来验证数据访问
  4. 检查Azure功能日志 有关详细的错误消息
  5. 验证MCP客户端配置 在ChatGPT/Claude设置中

MCP客户端配置

ChatGPT配置

在ChatGPT设置中,配置MCP服务器:

{
  "mcpServers": {
    "gloucestershire-councils": {
      "url": "https://your-function-app.azurewebsites.net/api/mcp",
      "apiKey": "your-api-key-if-needed"
    }
  }
}

Claude桌面配置

添加 claude_desktop_config.json:

{
  "mcpServers": {
    "gloucestershire-councils": {
      "command": "node",
      "args": ["/path/to/GCC-MCP-Pilot/mcp-stdio-wrapper.js"],
      "env": {
        "MODERNGOV_ENDPOINT": "https://democracy.gloucester.gov.uk/mgWebService.asmx"
      }
    }
  }
}

环境变量

变量描述默认值
MODERNGOV_ENDPOINT⚠️ 弃用-现在从议会配置中加载不适用

现在已在中配置了理事会终结点 json/Gloucestershire/councils.json.

MCP协议参考

此服务器实现了模型上下文协议(MCP)JSON-RPC接口:

方法

  • initialize -返回服务器功能、委员会列表和指令
  • tools/list -返回8个可用的JSON模式验证工具
  • tools/call -执行工具并返回结果
  • ping -健康检查

响应格式

所有响应均遵循JSON-RPC 2.0格式:

{
  "jsonrpc": "2.0",
  "result": { ... },
  "id": 1
}

工具调用结果以MCP内容格式包装:

{
  "jsonrpc": "2.0",
  "result": {
    "content": [
      {
        "type": "text",
        "text": "{ ...JSON result with date context wrapper... }"
      }
    ]
  },
  "id": 1
}

部署

使用以下方式部署到Azure功能:

func azure functionapp publish 

文档

许可证

麻省理工学院

目录标签

目录标签

JavaScriptClaude数据验证民主数据本地部署议会信息SOAP接口多议会支持

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

8

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP