moandersson/mcp-linstor
If you are the rightful owner of mcp-linstor and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
A Model Context Protocol (MCP) server for the Linstor storage system, enabling interaction with a Linstor cluster via its REST API.
Linstor MCP Server
A Model Context Protocol (MCP) server for Linstor storage system. This server provides MCP tools to interact with a Linstor cluster via its REST API, enabling AI assistants and other MCP clients to query and manage Linstor storage resources.
Features
- MCP Standard Compliance: Implements the MCP specification using FastMCP
- Streamable HTTP Transport: Uses streamable-http transport for efficient communication
- Tools:
ping
: Health check for Linstor API availabilitylist_resources
: Query all volume resources in the storage systemlist_nodes
: Query all nodes in the Linstor cluster
- Environment-based Configuration: Configuration via environment variables
Architecture
The project is structured for maintainability and testability:
mcp-linstor/
āāā server.py # Main MCP server with FastMCP
āāā config.py # Configuration management
āāā linstor_client.py # Linstor REST API client
āāā requirements.txt # Production dependencies
āāā requirements-dev.txt # Development dependencies
āāā tests/ # Comprehensive test suite
āāā test_config.py
āāā test_linstor_client.py
āāā test_server.py
Installation
Prerequisites
- Python 3.10 or higher
- Access to a Linstor cluster with REST API enabled
Setup
-
Clone or navigate to the project directory:
cd /path/to/mcp-linstor
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # On macOS/Linux # or venv\Scripts\activate # On Windows
-
Install dependencies:
pip install -r requirements.txt
-
For development (includes testing tools):
pip install -r requirements-dev.txt
Configuration
Configure the server using environment variables:
Variable | Description | Default |
---|---|---|
LINSTOR_BASE_URL | Base URL of the Linstor REST API | http://localhost:3370 |
LINSTOR_TIMEOUT | Request timeout in seconds | 30 |
LINSTOR_DEBUG | Enable debug logging | false |
LINSTOR_USERNAME | Optional: Username for authentication | None |
LINSTOR_PASSWORD | Optional: Password for authentication | None |
Example Configuration
export LINSTOR_BASE_URL="http://linstor-controller.example.com:3370"
export LINSTOR_TIMEOUT="60"
export LINSTOR_DEBUG="true"
Or create a .env
file:
LINSTOR_BASE_URL=http://linstor-controller.example.com:3370
LINSTOR_TIMEOUT=60
LINSTOR_DEBUG=true
LINSTOR_USERNAME=admin
LINSTOR_PASSWORD=secret
Usage
Running the Server
# Activate virtual environment
source venv/bin/activate
# Run the server
python server.py
The server will start on the default MCP streamable-http transport and will be ready to accept MCP client connections.
MCP Specification
This server implements the Model Context Protocol specification for tools:
- tool/list: Lists available tools (ping, list_resources, list_nodes)
- tool/call: Executes a tool with given parameters
- tool/results: Returns tool execution results
The server uses:
- Transport: streamable-http (stateless with JSON responses)
- FastMCP: Simplified MCP server implementation from the official Python SDK