chinmaybhatk/ONDC-MCP-Server-Unofficial
If you are the rightful owner of ONDC-MCP-Server-Unofficial 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 ONDC MCP Server is a comprehensive and unofficial implementation of the Model Context Protocol (MCP) server for ONDC APIs, designed to facilitate e-commerce, logistics, mobility, and financial services.
ONDC MCP Server - Comprehensive & Unofficial
A comprehensive Model Context Protocol (MCP) server for ONDC (Open Network for Digital Commerce) APIs. This server provides complete Beckn protocol compliance with 25+ API endpoints covering e-commerce, logistics, mobility, and financial services.
โ ๏ธ Unofficial Implementation: This is a community-driven, unofficial implementation of ONDC APIs for educational and development purposes.
๐ค Author
Primary Author: walue.biz
For detailed author and contributor information, see .
๐ Quick Start
# 1. Clone and install
git clone https://github.com/chinmaybhatk/ONDC-MCP-Server-Unofficial.git
cd ONDC-MCP-Server-Unofficial
npm install && npm run build
# 2. Configure Claude Desktop (see USAGE_GUIDE.md for details)
# Add server config to claude_desktop_config.json
# 3. Start using with Claude!
# "Search for organic vegetables in Bangalore on ONDC network"
๐
๐ฏ BAP and BPP Support
This MCP server now supports both BAP (Buyer Application Platform) and BPP (Buyer-side Platform Provider) implementations:
๐ BAP Features (Buyer Applications)
- Product discovery across ONDC network
- Order management and tracking
- Payment processing integration
- Multi-domain support (retail, food, mobility)
- Real-time order status updates
๐ช BPP Features (Seller Platforms)
- Catalog management and inventory sync
- Order processing and fulfillment
- Multi-location store management
- Analytics and reporting tools
- Webhook handling for BAP requests
๐ Documentation
- - Complete implementation details
- - Practical usage scenarios
๐ Quick Start
# For BAP (Buyer App) setup
cp templates/.env.bap.template .env
# For BPP (Seller Platform) setup
cp templates/.env.bpp.template .env
# Build and start
npm install && npm run build && npm start
๐ฌ Usage with Claude
Once configured, use natural language with Claude:
BAP Examples:
- "Search for organic vegetables in Bangalore on ONDC network"
- "Select 2kg apples from FreshMart and place order with UPI payment"
BPP Examples:
- "Add organic tomatoes to my grocery catalog with price โน80/kg"
- "Update order ORD123 status to 'Out for delivery' with tracking info"
๐ Features
Complete API Coverage (25+ Endpoints)
๐ง Registry APIs
ondc_subscribe
- Network Participant registrationondc_lookup
- Registry participant lookup
๐ Core Transaction APIs (BAP โ BPP)
ondc_search
- Discovery of products/servicesondc_select
- Selection of items from catalogondc_init
- Initialize order with billing/shippingondc_confirm
- Confirm the orderondc_status
- Check order statusondc_track
- Track order/fulfillmentondc_cancel
- Cancel orderondc_update
- Update orderondc_rating
- Rate and reviewondc_support
- Get support information
๐ Callback APIs (BPP โ BAP)
ondc_on_search
- Catalog response handlingondc_on_select
- Quote response handlingondc_on_init
- Payment terms responseondc_on_confirm
- Order confirmation responseondc_on_status
- Status update responseondc_on_track
- Tracking information responseondc_on_cancel
- Cancellation confirmationondc_on_update
- Update acknowledgmentondc_on_rating
- Rating acknowledgmentondc_on_support
- Support information response
๐ฏ Issue Management APIs
ondc_issue
- Raise an issue/disputeondc_issue_status
- Check issue statusondc_on_issue
- Issue acknowledgment responseondc_on_issue_status
- Issue status response
๐ Multi-Environment Support
- Staging - Development & testing
- Pre-Production - Final validation
- Production - Live ONDC network
๐ช Domain Support
- ONDC:RET10 - Grocery
- ONDC:RET11 - Food & Beverages
- ONDC:RET12 - Fashion
- ONDC:RET13 - Beauty & Personal Care
- ONDC:RET14 - Electronics
- ONDC:RET15 - Home & Decor
- ONDC:TRV10 - Mobility/Transportation
- ONDC:FIS12 - Financial Services
- ONDC:LOG10 - Logistics
๐ Built-in Security
- Ed25519 signature authentication
- Environment-specific endpoint configuration
- Proper request validation and error handling
- Digital signing for all transactions
๐ฏ Natural Language Usage Examples
Once set up, use Claude with natural language:
Registry Operations
"Register my grocery delivery app on ONDC staging environment with domain ONDC:RET10 for Bangalore operations"
Product Discovery
"Search for organic vegetables available for delivery in Bangalore area code 560001"
"Find electronics stores selling smartphones under โน20,000 in Chennai"
"Look for restaurants serving North Indian food in Delhi with home delivery"
Order Management
"Check the status of order ORD123456 on the ONDC network"
"Track delivery for order ORD789012"
"Cancel order ORD345678 with reason 'customer request'"
Complete Workflows
1. "Search for fresh fruits in Mumbai on ONDC retail network"
2. "Select 2kg apples and 1kg oranges from seller SEL123"
3. "Initialize order with billing address in Bandra, Mumbai"
4. "Confirm the order with UPI payment"
5. "Track the order delivery status"
๐ฆ Installation
Prerequisites
- Node.js 18+
- npm or yarn
- TypeScript 5.0+
Quick Start
# Clone the repository
git clone https://github.com/chinmaybhatk/ONDC-MCP-Server-Unofficial.git
cd ONDC-MCP-Server-Unofficial
# Install dependencies
npm install
# Build the project
npm run build
# Run the server
npm start
Development Mode
# Run in development mode with hot reload
npm run dev
# Watch for changes
npm run watch
๐ง Configuration
ONDC Credentials Setup
-
Get ONDC Network Participant credentials:
- Register on the ONDC Network Participant Portal
- Complete your profile 100%
- Submit environment access requests
- Generate signing and encryption key pairs
-
Configure Environment: Create
.env
file with your ONDC credentials (see )
Claude Desktop Integration
Add to your Claude Desktop config file:
{
"mcpServers": {
"ondc-comprehensive": {
"command": "node",
"args": ["/absolute/path/to/ONDC-MCP-Server-Unofficial/build/index.js"],
"env": {
"NODE_ENV": "production",
"ONDC_ENVIRONMENT": "staging"
}
}
}
}
๐
๐ฎ Real-World Use Cases
E-commerce Platform Integration
"Help me integrate my existing e-commerce platform with ONDC network for multi-seller marketplace"
Restaurant Chain Operations
"Connect my restaurant chain to ONDC for food delivery across multiple cities"
Logistics Provider Onboarding
"Register my logistics company as a BPP on ONDC for last-mile delivery services"
Business Analytics
"Analyze order patterns and seller performance on my ONDC-integrated marketplace"
"Generate sales report for last month from all ONDC channels"
๐งช Testing
# Run tests
npm test
# Lint code
npm run lint
# Format code
npm run format
๐ Advanced Features
Webhook Simulation
The server includes callback API handlers for simulating webhook responses during development.
Multi-Domain Support
Easily switch between different ONDC domains (retail, logistics, mobility, financial services).
Error Handling
Comprehensive error handling with detailed error messages and proper HTTP status codes.
Request Validation
Built-in validation for all API parameters and request bodies.
๐ Documentation
- - Step-by-step setup and usage
- - How to contribute
- - Project contributors
- - Configuration examples and scripts
- - Version history
๐ค Contributing
We welcome contributions! Please see our for details.
Development Setup
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes
- Add tests if applicable
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
๐ Resources
ONDC Documentation
Beckn Protocol
Model Context Protocol
๐ Security Considerations
- Private Key Security: Never expose your private keys in code or logs
- Environment Isolation: Use separate credentials for staging/preprod/prod
- Request Validation: All requests are authenticated using Ed25519 signatures
- SSL/TLS: All communications use HTTPS
- Rate Limiting: Implement appropriate limits for API calls
๐ License
This project is licensed under the MIT License - see the file for details.
โ ๏ธ Disclaimer
This is an unofficial MCP server for ONDC APIs created for educational and development purposes. It is not officially endorsed by ONDC or any related organizations. Please ensure compliance with ONDC's terms of service and technical requirements when using this server in production environments.
๐ Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Complete Usage Guide:
For ONDC-specific questions:
Made with โค๏ธ by walue.biz and the ONDC Community
Star โญ this repository if you find it helpful!