oracle-unshipped-orders-mcp

oracle-unshipped-orders-mcp

Enables retrieval of unshipped orders from an Oracle/Blue Yonder WMS database, filtering by customer and excluding shipped items.

Category
访问服务器

README

Oracle Unshipped Orders MCP Server

MCP (Model Context Protocol) server for retrieving unshipped orders from Oracle/Red Prairie Blue Yonder WMS database.

🔒 Security Features

  • Environment Variables: All credentials stored in .env (git-ignored)
  • Connection Pooling: Efficient database connection management
  • No Hardcoded Credentials: Zero credentials in source code
  • Oracle Best Practices: Uses oracledb official driver with secure connection handling

🚀 Quick Start

1. Install Dependencies

cd oracle-unshipped-orders-mcp
npm install

2. Configure Database Credentials

IMPORTANT: Create a .env file (this file is git-ignored and will NOT be committed):

cp .env.example .env

Edit .env and add your actual Oracle credentials:

ORACLE_USER=your_actual_username
ORACLE_PASSWORD=your_actual_password
ORACLE_CONNECTION_STRING=your_host:1521/your_service_name

Example:

ORACLE_USER=wmsuser
ORACLE_PASSWORD=SecureP@ssw0rd123
ORACLE_CONNECTION_STRING=db.bolthousefresh.com:1521/REDPRAIRIE

3. Build the Project

npm run build

4. Test the MCP Server

npm test

The server will:

  • ✅ Connect to your Oracle database
  • ✅ Initialize connection pool
  • ✅ Start the MCP server on stdio
  • ✅ Be ready to accept tool calls

🛠️ Available Tools

get_unshipped_orders

Retrieves all unshipped orders for a specific customer.

Input:

  • stcust (string, required): Ship-to Customer ID

Output:

{
  "success": true,
  "customer": "CUST001",
  "total_orders": 5,
  "orders": [
    {
      "ORDNUM": "ORD12345",
      "WH_ID": "DC01",
      "STCUST": "CUST001",
      "BTCUST": "CUST001",
      "BT_ADR_ID": "ADDR001",
      "ADDDTE": "2026-06-25",
      "EXPSHIP": "2026-07-02",
      "APPTTIME": "10:00",
      "CPONUM": "PO98765",
      "PRTNUM": "PART123",
      "ORDQTY": 100,
      "ORDLIN": 1,
      "INPQTY": 100,
      "PCKQTY": 100,
      "STGQTY": 100,
      "SHPQTY": 0
    }
  ]
}

Query Logic:

  • Filters orders with shpqty = 0 (zero shipped quantity)
  • Includes orders with dispatch_dte is null (not yet dispatched)
  • Excludes alcohol items (non_alc_flg = 0)
  • Joins truck dispatch details for expected ship dates and appointment times

📁 Project Structure

oracle-unshipped-orders-mcp/
├── src/
│   └── index.ts          # Main MCP server code
├── dist/                 # Compiled JavaScript (generated)
├── package.json          # Dependencies and scripts
├── tsconfig.json         # TypeScript configuration
├── .env.example          # Template for credentials (safe to commit)
├── .env                  # YOUR ACTUAL CREDENTIALS (git-ignored)
├── .gitignore            # Protects sensitive files
└── README.md             # This file

🔐 Security Checklist

Before committing to GitHub:

  • .env file is listed in .gitignore
  • ✅ No credentials in source code
  • ✅ Only .env.example (with placeholders) is committed
  • ✅ Verify: git status should NOT show .env

🚢 Deployment to Railway

Option 1: Railway CLI

railway login
railway init
railway up

In Railway dashboard, add environment variables:

  • ORACLE_USER
  • ORACLE_PASSWORD
  • ORACLE_CONNECTION_STRING

Option 2: GitHub Integration

  1. Push code to GitHub (credentials are git-ignored)
  2. Connect Railway to your GitHub repo
  3. Add environment variables in Railway dashboard
  4. Deploy automatically on push

🧪 Testing Locally with MCP Inspector

npx @modelcontextprotocol/inspector node dist/index.js

This opens a web interface where you can:

  • Test the get_unshipped_orders tool
  • Inspect requests/responses
  • Debug connection issues

📝 SQL Query Details

The MCP executes this query (with customer filter):

SELECT o.ordnum, o.wh_id, o.stcust, o.btcust, o.bt_adr_id,
       o.adddte, dtl.expship, mst.appttime, o.cponum,
       ol.prtnum, ol.ordqty, ol.ordlin,
       sl.inpqty, sl.pckqty, sl.stgqty, sl.shpqty
FROM ord o
INNER JOIN ord_line ol ON o.wh_id = ol.wh_id AND o.ordnum = ol.ordnum
INNER JOIN shipment_line sl ON ol.wh_id = sl.wh_id AND ol.ordnum = sl.ordnum 
                            AND ol.ordlin = sl.ordlin AND ol.ordsln = sl.ordsln
INNER JOIN shipment shp ON sl.wh_id = shp.wh_id AND sl.ship_id = shp.ship_id
INNER JOIN stop stp ON shp.stop_id = stp.stop_id
INNER JOIN car_move car ON stp.car_move_id = car.car_move_id
INNER JOIN trlr trl ON car.trlr_id = trl.trlr_id
INNER JOIN usrtruckdspdetail dtl ON dtl.ordnum = o.ordnum AND dtl.wh_id = o.wh_id
INNER JOIN usrtruckdspmaster mst ON mst.wh_id = dtl.wh_id AND mst.mstordnum = dtl.mstordnum
WHERE trl.dispatch_dte IS NULL
  AND sl.shpqty = 0
  AND ol.non_alc_flg = 0
  AND o.stcust = :stcust
ORDER BY o.ordnum, ol.ordlin

🐛 Troubleshooting

"Database pool not initialized"

  • Check .env file exists and has correct credentials
  • Verify Oracle connection string format: host:port/service_name

"ORA-12154: TNS:could not resolve the connect identifier"

  • Verify ORACLE_CONNECTION_STRING format
  • Check network connectivity to Oracle server
  • Ensure firewall allows connection on Oracle port (usually 1521)

"ORA-01017: invalid username/password"

  • Double-check credentials in .env
  • Verify user has SELECT privileges on required tables

No results returned

  • Verify customer ID (stcust) exists in database
  • Check if customer has unshipped orders matching the criteria
  • Test query directly in SQL*Plus or SQL Developer

📚 References

👤 Author

Rakesh - Sr. Systems Programmer/Analyst
New Carrot Farms LLC dba Bolthouse Fresh Foods

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选