wsyeabsera/v5-orchestrator-mcp-server
If you are the rightful owner of v5-orchestrator-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 dayong@mcphub.com.
A Model Context Protocol (MCP) server designed for waste management, utilizing TypeScript and Mongoose to handle data related to facilities, contaminants, inspections, shipments, and contracts.
Waste Management MCP Server
A Model Context Protocol (MCP) server built with TypeScript and Mongoose for managing facilities, contaminants, inspections, shipments, and contracts data.
Features
- HTTP + SSE Transport: Accessible over the internet via URL
- 5 Collections: Facilities, Contaminants, Inspections, Shipments, and Contracts
- 30+ Tools: Full CRUD operations plus AI-powered intelligent tools
- MCP Sampling Support: AI-assisted analysis and decision making
- Mongoose ODM: Schema validation and relationships between collections
- TypeScript: Type-safe development
- RESTful Health Checks: Monitor server and database status
- 4 Prompts: Pre-configured prompts for AI-assisted workflows
- Dynamic Resources: Real-time data access via MCP resources
Prerequisites
- Node.js 18+
- MongoDB (local or remote instance)
- npm or yarn
Installation
- Clone the repository and navigate to the project directory:
cd mcp-server
- Install dependencies:
npm install
- Create a
.envfile in the root directory:
cp .env.example .env
- Configure your environment variables in
.env:
MONGODB_URI=mongodb://localhost:27017/mcp-server
PORT=5000
NODE_ENV=development
Usage
Development Mode
Run with hot reload:
npm run dev
Production Mode
Build and run:
npm run build
npm start
Server Endpoints
- Root:
http://localhost:5000/- Server information - SSE:
http://localhost:5000/sse- MCP SSE connection endpoint - Messages:
http://localhost:5000/messages- POST endpoint for MCP messages - Health:
http://localhost:5000/health- Health check endpoint
Connecting MCP Clients
Using with Cursor
Add to your Cursor MCP settings (~/.cursor/mcp.json or workspace settings):
{
"mcpServers": {
"waste-management": {
"url": "http://localhost:5000/sse"
}
}
}
For remote servers, replace localhost:5000 with your server's URL.
Using with Other MCP Clients
Configure the client to connect to the SSE endpoint: http://your-server-url:5000/sse
Available Tools
Facilities (5 tools)
create_facility- Create a new facilityget_facility- Get facility by IDlist_facilities- List all facilities with optional filtersupdate_facility- Update facility by IDdelete_facility- Delete facility by ID
Contaminants (5 tools)
create_contaminant- Create a new contaminant recordget_contaminant- Get contaminant by IDlist_contaminants- List all contaminants with optional filtersupdate_contaminant- Update contaminant by IDdelete_contaminant- Delete contaminant by ID
Inspections (5 tools)
create_inspection- Create a new inspectionget_inspection- Get inspection by IDlist_inspections- List all inspections with optional filtersupdate_inspection- Update inspection by IDdelete_inspection- Delete inspection by ID
Shipments (5 tools)
create_shipment- Create a new shipmentget_shipment- Get shipment by IDlist_shipments- List all shipments with optional filtersupdate_shipment- Update shipment by IDdelete_shipment- Delete shipment by ID
Contracts (5 tools)
create_contract- Create a new contractget_contract- Get contract by IDlist_contracts- List all contracts with optional filtersupdate_contract- Update contract by IDdelete_contract- Delete contract by ID
AI-Powered Tools with Sampling
The server now includes MCP Sampling capabilities, allowing tools to request AI assistance during execution. These intelligent tools combine database queries with AI analysis to provide actionable insights.
Intelligent Analysis Tools (3 tools)
generate_intelligent_facility_report
Generate comprehensive facility reports with AI-powered health scores, risk assessments, and recommendations.
Parameters:
facilityId(required) - Facility to analyzeincludeRecommendations(optional) - Include AI-generated recommendations
What it provides:
- Overall facility health score (0-100)
- Top concerns and risk areas
- Compliance risk level assessment
- Actionable recommendations
- Comprehensive metrics and historical data
analyze_shipment_risk
Perform AI-powered risk assessment for shipments based on contamination history and patterns.
Parameters:
shipmentId(required) - Shipment to analyze
What it provides:
- AI-generated risk score (0-100)
- Risk factors and reasoning
- Source history analysis
- Recommended actions
- Detailed contamination breakdown
suggest_inspection_questions
Generate customized inspection checklists using AI elicitation and analysis.
Parameters:
facilityId(required) - Facility to generate questions for
What it provides:
- AI-selected focus area (contamination, acceptance, processing, or compliance)
- Customized inspection questions (5-7 targeted questions)
- Facility-specific metrics and concerns
- Additional notes based on risk indicators
How Sampling Works
When you call these tools, the server:
- Fetches relevant data from MongoDB
- Requests AI analysis from the connected MCP client
- Combines raw data with AI insights
- Returns comprehensive, actionable results
Example:
{
"name": "generate_intelligent_facility_report",
"arguments": {
"facilityId": "65f1234567890abcdef12345",
"includeRecommendations": true
}
}
Learn More
- - Detailed guide on using AI-powered tools
- - Step-by-step testing with MCP Inspector
- MCP Specification - Official sampling documentation
Data Models
Facility
name: stringshortCode: string (unique)location: stringtimestamps: createdAt, updatedAt
Contaminant
wasteItemDetected: stringmaterial: stringfacilityId: ObjectId (ref: Facility)detection_time: Dateexplosive_level: enum (low, medium, high)hcl_level: enum (low, medium, high)so2_level: enum (low, medium, high)estimated_size: numbershipment_id: stringtimestamps: createdAt, updatedAt
Inspection
facility_id: ObjectId (ref: Facility)is_delivery_accepted: booleandoes_delivery_meets_conditions: booleanselected_wastetypes: array of {category: string, percentage: string}heating_value_calculation: numberwaste_producer: stringcontract_reference_id: stringtimestamps: createdAt, updatedAt
Shipment
entry_timestamp: Dateexit_timestamp: Datesource: stringfacilityId: ObjectId (ref: Facility)license_plate: stringcontract_reference_id: stringcontractId: stringtimestamps: createdAt, updatedAt
Contract
producerName: stringdebitorName: stringwasteCode: stringtimestamps: createdAt, updatedAt
Deployment
Deploy to Railway
- Install Railway CLI:
npm install -g @railway/cli
- Login and deploy:
railway login
railway init
railway up
- Set environment variables in Railway dashboard:
MONGODB_URIPORT(Railway will set this automatically)NODE_ENV=production
Deploy to Other Platforms
The server can be deployed to any platform that supports Node.js applications:
- Heroku
- AWS (EC2, ECS, Lambda)
- Google Cloud Platform
- DigitalOcean
- Vercel (with serverless functions)
Make sure to:
- Set the required environment variables
- Use a production MongoDB instance (e.g., MongoDB Atlas)
- Configure CORS if needed for specific domains
Development
Project Structure
mcp-server/
├── src/
│ ├── models/ # Mongoose schemas
│ │ ├── Facility.ts
│ │ ├── Contaminant.ts
│ │ ├── Inspection.ts
│ │ ├── Shipment.ts
│ │ ├── Contract.ts
│ │ └── index.ts
│ ├── tools/ # MCP tool implementations
│ │ ├── facilityTools.ts
│ │ ├── contaminantTools.ts
│ │ ├── inspectionTools.ts
│ │ ├── shipmentTools.ts
│ │ ├── contractTools.ts
│ │ └── index.ts
│ ├── db.ts # Database connection
│ ├── config.ts # Configuration management
│ └── index.ts # Main server entry point
├── package.json
├── tsconfig.json
└── README.md
License
MIT
Support
For issues, questions, or contributions, please open an issue in the repository.