cdi-mcp-server
v1.0.0
Published
CDI (Chemical Distribution Institute) MCP Server for retrieving and processing maritime inspection data with full CDI authentication support
Maintainers
Readme
CDI MCP Server
A Model Context Protocol (MCP) server implementation in TypeScript that provides data retrieval capabilities for CDI (Chemical Distribution Institute) maritime data.
Overview
The CDI Data MCP Server is designed to fetch and process maritime inspection data from CDI and other maritime data sources. It provides a standardized interface for accessing vessel inspection reports, downloading PDF documents, and managing maritime compliance data.
Features
- API Data Integration: Fetch vessel inspection data from CDI maritime database
- PDF Document Management: Automatically download and organize inspection reports
- Vessel Information Retrieval: Access comprehensive vessel details and inspection history
- Session Management: Secure authentication and session handling for external APIs
- Data Processing: Parse and structure maritime data for easy consumption
- MCP Protocol Support: Full compatibility with Model Context Protocol for AI integration
Installation
You can install and run the CDI MCP Server in several ways:
Using npx (Recommended)
npx cdi-mcp-serverGlobal Installation
npm install -g cdi-mcp-server
cdi-mcp-serverLocal Development
Clone the repository:
git clone https://github.com/syia-ai/cdi-mcp-server.git cd cdi-mcp-serverInstall dependencies:
npm installSet up environment variables: Create a
.envfile in the project root with:# CDI Authentication (replace {doc_name} with actual document names) CDI_{DOC_NAME}_USERNAME=your_username CDI_{DOC_NAME}_PASSWORD=your_password
Project Structure
cdi-mcp-server/
├── src/
│ ├── index.ts # Main server entry point
│ ├── tools.ts # Core CDI data scraping implementation
│ ├── types.ts # TypeScript type definitions
│ ├── utils.ts # Utility functions
│ └── test.ts # Test suite
├── bin/
│ └── cli.js # CLI entry point
├── dist/ # Compiled JavaScript files
├── .eslintrc # ESLint configuration
├── .prettierrc # Prettier configuration
├── .gitignore # Git ignore rules
├── package.json # Project dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── install.js # Post-install script
└── README.md # Project documentationAvailable Scripts
npm start- Start the MCP servernpm run dev- Run in development mode with auto-reloadnpm run build- Build the TypeScript codenpm test- Run MCP inspector testsnpm run install-global- Install package globallynpx cdi-mcp-server- Run directly with npx
MCP Tool Documentation
cdi_data_main
The server provides a tool called cdi_data_main that retrieves CDI inspection data and downloads associated PDF reports.
Input Schema:
{
"type": "object",
"properties": {
"doc_name": {
"type": "string",
"description": "The document name identifier for the vessel"
}
},
"required": ["doc_name"]
}Returns:
- List of inspection records with metadata
- Local file paths to downloaded PDF reports
- Vessel information and inspection details
Available Document Names
The following doc_name values are supported:
| Document Name | Description | Required Environment Variables |
|--------------|-------------|------------------------------|
| SMEC | Synergy Marine Enterprise Corp | CDI_SMEC_USERNAME, CDI_SMEC_PASSWORD |
| SMC | Synergy Marine Corp | CDI_SMC_USERNAME, CDI_SMC_PASSWORD |
| SMPL | Synergy Marine Private Limited | CDI_SMPL_USERNAME, CDI_SMPL_PASSWORD |
| SDK | Synergy Denmark | CDI_SDK_USERNAME, CDI_SDK_PASSWORD |
| SNPL | Synergy Navis Private Limited | CDI_SNPL_USERNAME, CDI_SNPL_PASSWORD |
| SOPL | Synergy Oceanic Private Limited | CDI_SOPL_USERNAME, CDI_SOPL_PASSWORD |
| SMID | Synergy Marine Indonesia | CDI_SMID_USERNAME, CDI_SMID_PASSWORD |
Development
Code Style
The project uses:
- TypeScript for type safety
- ESLint for code linting
- Prettier for code formatting
Testing
The project includes a test suite that:
- Validates CDI data retrieval
- Tests PDF download functionality
- Verifies data structure integrity
- Checks authentication flow
Run tests with:
npm testError Handling
The server includes comprehensive error handling for:
- Authentication failures
- Network connectivity issues
- Data parsing errors
- File system operations
- Session management
Logging
The server uses Winston for logging with:
- Detailed operation logging
- Error tracking
- PDF download status
- Session management events
File Storage
Downloaded PDF reports are stored in the downloads/ directory with a structured naming convention:
downloads/
└── {vessel_name}_{imo}_{inspection_date}.pdfContributing
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
License
MIT License - See LICENSE file for details
