fabio-pardo/mxp-mcp-server
If you are the rightful owner of mxp-mcp-server 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.
The Virgin Voyages MXP-MCP Server is a Model Context Protocol server that provides a REST API interface to the Virgin Voyages MXP system, exposing its functionality through convenient API endpoints while adhering to the MCP standard.
Virgin Voyages MXP-MCP Server
A Model Context Protocol (MCP) server that provides a REST API interface to the Virgin Voyages MXP system. This server exposes MXP functionality through convenient API endpoints while maintaining the MCP standard.
Usage
Endpoints
MCP Endpoints
GET /
ā Health check, returns server statusGET /healthz
ā Health check, returns OKPOST /mcp
ā Main MCP endpoint (accepts JSON with action and parameters)
MXP API Endpoints
GET /account/{charge_id}
ā Get account information by charge IDGET /crew
ā Get crew informationGET /folio/{folio_id}
ā Get folio information by folio IDGET /document/{document_id}
ā Get document information by document IDGET /icafe
ā Get iCafe information (optional: ?icafe_id=123)GET /person_image/{person_id}
ā Get person image by person IDGET /quick_code
ā Get quick code informationGET /sailor_manifest
ā Get sailor manifest informationGET /receipt_image/{receipt_id}
ā Get receipt image by receipt IDGET /person_invoice/{person_id}
ā Get person invoice by person ID
Example: List Resources via MCP
POST /mcp
{
"action": "list_resources",
"parameters": {}
}
Example: Read Resource (Account) via MCP
POST /mcp
{
"action": "read_resource",
"parameters": {
"resource_type": "account",
"charge_id": 10000004
}
}
Environment Variables Configuration
The server uses environment variables for configuration which can be set in a .env
file in the project root:
# .env file example
MXP_BASE_URL=http://api.example.com/mxp/api
MXP_USERNAME=example_user
MXP_PASSWORD=example_password
Key environment variables:
Variable | Description | Default |
---|---|---|
MXP_BASE_URL | Base URL for the MXP API | http://localhost/api |
MXP_USERNAME | Username for MXP API authentication | username |
MXP_PASSWORD | Password for MXP API authentication | password |
PORT | Port for the server to listen on | 8000 |
Running the Server
Local Development
# Ensure dependencies are installed
pip install -r requirements.txt
# Run the server
python server.py
Using Docker
# Build and run with Docker
docker build -t mxp-mcp-server .
docker run -p 8000:8000 --env-file .env mxp-mcp-server
Using Docker Compose (Recommended)
# Build and start the server with Docker Compose
docker-compose up --build
The server will be available at http://localhost:8000/
OpenAPI Docs
FastAPI automatically provides OpenAPI docs at:
http://localhost:8000/docs
(Swagger UI)http://localhost:8000/redoc
(ReDoc)
What is an MCP Server?
The Model Context Protocol (MCP) is a standard that connects AI systems with external tools and data sources. MCP servers extend AI capabilities by providing access to specialized functions, external information, and services.
Project Structure
mcp-server/
āāā Dockerfile # Container definition
āāā requirements.txt # Python dependencies
āāā server.py # Main server implementation
āāā tools/ # Directory for tool implementations
ā āāā __init__.py
ā āāā example_tool.py # Example tool implementation
āāā README.md # This file
Getting Started
Local Development
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the server:
python server.py
The server will start on http://localhost:8000
Docker Deployment
-
Build the Docker image:
docker build -t mcp-server .
-
Run the container:
docker run -p 8000:8000 mcp-server
The server will be accessible at http://localhost:8000
API Endpoints
GET /
: Server statusGET /healthz
: Health check endpointPOST /mcp
: Main MCP request endpointGET /list-tools
: List available toolsPOST /debug
: Debug endpoint that echoes back the request
Adding New Tools
To add a new tool:
- Create a new file in the
tools/
directory (e.g.,tools/my_tool.py
) - Implement your tool class with an
execute()
method - Import and initialize your tool in
server.py
- Add a new condition in the
/mcp
endpoint handler to dispatch requests to your tool - Update the tool list in the
/list-tools
endpoint
Example Request
curl -X POST http://localhost:8000/mcp \
-H "Content-Type: application/json" \
-d '{
"action": "example_tool",
"parameters": {
"message": "Hello, MCP!"
}
}'
Expected response:
{
"result": {
"echo": "Hello, MCP!",
"timestamp": "2025-05-21T13:49:25-04:00"
},
"error": null,
"metadata": null
}
Deployment Considerations
- Set environment variables for configuration in production
- Consider using a production-grade ASGI server for deployment
- Implement proper authentication for production deployments