FIWARE MCP Server
FIWARE MCP 服务器
这是 FIWARE 模型上下文协议 (MCP) 服务器的首次实现,该服务器在上下文代理和其他服务之间架起了桥梁。该服务器实现了与 FIWARE 上下文代理交互的基本操作。
目标
为 FIWARE 创建基本的 MCP 服务器实现
提供用于 Context Broker 交互的简单工具
使用 Context Broker 演示基本意图 CRUD 操作
为更复杂的 MCP 实现奠定基础
Related MCP server: Synapse MCP Server
特征
Context Broker 版本检查
Context Broker 的查询功能
实体发布和更新
先决条件
Python 3.7 或更高版本
pip(Python 包安装程序)
访问 FIWARE Context Broker 实例
安装
克隆此存储库:
git clone <repository-url>
cd FIWARE_MCP_01安装所需的依赖项:
pip install -r requirements.txtClaude 桌面集成
mcp install server.py
# Custom name
mcp install server.py --name "FIWARE MCP Server"
# Environment variables, if any
mcp install server.py -v API_KEY=abc123 -v DB_URL=postgres://...
mcp install server.py -f .env用法
启动 MCP 服务器:
python server.py
# or
mcp run server.py服务器默认从127.0.0.1:5001启动。
可用工具
CB_版本
检查 Context Broker 的版本
默认参数:address="localhost",port=1026
返回:包含版本信息的 JSON 字符串
查询_CB
查询上下文代理
参数:
地址(默认值:“localhost”)
端口(默认值:1026)
查询(默认值:“”)
返回:包含查询结果的 JSON 字符串
发布到 CB
在 Context Broker 中发布或更新实体
参数:
地址(默认值:“localhost”)
端口(默认值:1026)
entity_data(必需:包含实体信息的字典)
返回:带有操作状态的 JSON 字符串
示例用法
# Example entity data
entity_data = {
"id": "urn:ngsi-ld:TemperatureSensor:001",
"type": "TemperatureSensor",
"temperature": {
"type": "Property",
"value": 25.5
},
"@context": "https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld"
}
# Publish to Context Broker
result = publish_to_CB(entity_data=entity_data)配置
可以通过修改server.py中的以下参数来配置服务器:
主机地址
端口号
超时设置
错误处理
该服务器包括针对以下方面的全面错误处理:
网络连接问题
来自上下文代理的无效响应
格式错误的实体数据
服务器关闭
贡献
请随时提交问题和增强请求!
执照
该项目采用 Apache License 2.0 许可。
This server cannot be deployed
Maintenance
Related MCP Connectors
The official MCP Server from Mia-Platform to interact with Mia-Platform Console
Manage products, EU Digital Product Passports, operator parties, and GS1 EPCIS supply-chain events.
Query, browse, and automate OmegaAI workspaces from any MCP client. Streamable HTTP with OAuth 2.0.
A server to provide information about EOxElements custom elements for coding agents.
Related MCP Servers
- AlicenseBqualityDmaintenanceA Model Context Protocol (MCP) server implementation that provides EMQX MQTT broker interaction.426Apache 2.0
- AlicenseCqualityFmaintenanceA Model Context Protocol server that exposes Synapse Entities (Datasets, Projects, Folders, Files, Tables) with their annotations, enabling programmatic access to Synapse data resources through a RESTful API.711MIT
- FlicenseNot gradedqualityDmaintenanceEnables creation and management of knowledge graphs with entities, relationships, and observations through HTTP streaming. Supports persistent storage, search functionality, and CRUD operations for building and querying interconnected knowledge bases.2-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to interact with IoT device data from a smart city, including public lighting, water, and gas meters. Supports querying and management via the Model Context Protocol.1MIT