FIWARE MCP Server
A bridge between the Context Broker and other services, implementing basic operations for entity publishing, updating, and querying in FIWARE environments.
A bridge between the Context Broker and other services, implementing basic operations for entity publishing, updating, and querying in FIWARE environments.
This is a first implementation of a FIWARE Model Context Protocol (MCP) Server that provides a bridge between the Context Broker and other services. The server implements basic operations for interacting with a FIWARE Context Broker.
Clone this repository:
git clone <repository-url>
cd FIWARE_MCP_01
Install the required dependencies:
pip install -r requirements.txt
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
Start the MCP server:
python server.py
# or
mcp run server.py
The server will start on 127.0.0.1:5001
by default.
Returns: JSON string with version information
query_CB
Returns: JSON string with query results
publish_to_CB
# 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)
The server can be configured by modifying the following parameters in server.py
:
- Host address
- Port number
- Timeout settings
The server includes comprehensive error handling for: - Network connectivity issues - Invalid responses from the Context Broker - Malformed entity data - Server shutdown
Feel free to submit issues and enhancement requests!
This project is licensed under the Apache License 2.0.