indian-parcel-mcp 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -4
- package/dist/server.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,11 +86,77 @@ npx -y indian-parcel-mcp
|
|
|
86
86
|
|
|
87
87
|
## Add To Your MCP Client
|
|
88
88
|
|
|
89
|
-
Configure your preferred MCP client to use the published package via `npx` (recommended)
|
|
89
|
+
Configure your preferred MCP client to use the published package via `npx` (recommended) or from your local build.
|
|
90
|
+
|
|
91
|
+
### MCP Configuration File Paths
|
|
92
|
+
|
|
93
|
+
Below are the default configuration file paths for popular MCP clients:
|
|
94
|
+
|
|
95
|
+
| Client / Agent | Scope | Configuration File Path |
|
|
96
|
+
|---|---|---|
|
|
97
|
+
| **Claude Desktop** | Global (macOS) | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
98
|
+
| | Global (Windows) | `%APPDATA%\Claude\claude_desktop_config.json` |
|
|
99
|
+
| **Cursor** | Global | `~/.cursor/mcp.json` |
|
|
100
|
+
| | Project | `.cursor/mcp.json` |
|
|
101
|
+
| **Cline** | Global | `~/.cline/data/settings/cline_mcp_settings.json` |
|
|
102
|
+
| | Project | `.cline/mcp.json` |
|
|
103
|
+
| **Roo Code** | Global (macOS) | `~/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json` |
|
|
104
|
+
| | Global (Windows) | `%APPDATA%\Code\User\globalStorage\rooveterinaryinc.roo-cline\settings\cline_mcp_settings.json` |
|
|
105
|
+
| | Project | `.roo/mcp.json` |
|
|
106
|
+
| **Windsurf** | Global (macOS) | `~/.codeium/windsurf/mcp_config.json` |
|
|
107
|
+
| | Global (Windows) | `%APPDATA%\Codeium\Windsurf\mcp_config.json` |
|
|
108
|
+
| **Antigravity CLI / Editor** | Global | `~/.antigravitycli/mcp.json` |
|
|
109
|
+
|
|
110
|
+
---
|
|
90
111
|
|
|
91
112
|
### Claude Desktop
|
|
92
113
|
|
|
93
|
-
Add this to
|
|
114
|
+
Add this to your Claude Desktop configuration file (located at the path above):
|
|
115
|
+
|
|
116
|
+
```json
|
|
117
|
+
{
|
|
118
|
+
"mcpServers": {
|
|
119
|
+
"indian-parcel": {
|
|
120
|
+
"command": "npx",
|
|
121
|
+
"args": ["-y", "indian-parcel-mcp"]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Cursor
|
|
128
|
+
|
|
129
|
+
Add this to either your global or project-specific `mcp.json` file:
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"mcpServers": {
|
|
134
|
+
"indian-parcel": {
|
|
135
|
+
"command": "npx",
|
|
136
|
+
"args": ["-y", "indian-parcel-mcp"]
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Cline / Roo Code
|
|
143
|
+
|
|
144
|
+
Add this to your global settings file or project settings file:
|
|
145
|
+
|
|
146
|
+
```json
|
|
147
|
+
{
|
|
148
|
+
"mcpServers": {
|
|
149
|
+
"indian-parcel": {
|
|
150
|
+
"command": "npx",
|
|
151
|
+
"args": ["-y", "indian-parcel-mcp"]
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Windsurf
|
|
158
|
+
|
|
159
|
+
Add this to your Windsurf configuration file:
|
|
94
160
|
|
|
95
161
|
```json
|
|
96
162
|
{
|
|
@@ -138,6 +204,7 @@ Add this to your Antigravity MCP config:
|
|
|
138
204
|
}
|
|
139
205
|
```
|
|
140
206
|
|
|
207
|
+
|
|
141
208
|
---
|
|
142
209
|
|
|
143
210
|
## Local Development (Optional)
|
|
@@ -168,11 +235,11 @@ A template local configuration is available in [examples/claude-desktop-config.j
|
|
|
168
235
|
Once connected, ask your MCP client directly:
|
|
169
236
|
|
|
170
237
|
```text
|
|
171
|
-
Track this India package with indian-parcel:
|
|
238
|
+
Track this India package with indian-parcel: 21098765432
|
|
172
239
|
```
|
|
173
240
|
|
|
174
241
|
```text
|
|
175
|
-
Use track_shipment for AWB
|
|
242
|
+
Use track_shipment for AWB 18098765432. It must arrive before 2026-05-26T12:00:00+05:30.
|
|
176
243
|
```
|
|
177
244
|
|
|
178
245
|
```text
|
package/dist/server.js
CHANGED
|
@@ -252,4 +252,4 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
252
252
|
,
|
|
253
253
|
consecutive_failures INTEGER NOT NULL DEFAULT 0
|
|
254
254
|
);
|
|
255
|
-
`);let e=this.db.prepare("PRAGMA table_info(watches)").all(),r=new Set(e.map(i=>i.name)),n=[["last_phase","ALTER TABLE watches ADD COLUMN last_phase TEXT"],["last_location","ALTER TABLE watches ADD COLUMN last_location TEXT"],["last_scan_at","ALTER TABLE watches ADD COLUMN last_scan_at TEXT"],["last_reasoning","ALTER TABLE watches ADD COLUMN last_reasoning TEXT"],["last_error","ALTER TABLE watches ADD COLUMN last_error TEXT"],["last_change_at","ALTER TABLE watches ADD COLUMN last_change_at TEXT"],["consecutive_failures","ALTER TABLE watches ADD COLUMN consecutive_failures INTEGER NOT NULL DEFAULT 0"]];for(let[i,s]of n)r.has(i)||this.db.exec(s)}},ga=new rk;async function yJ(t){let e=Jc(t.awb),r=e.carrier==="unknown"?"unknown":e.carrier;return{watch_id:ga.addWatch({awb:t.awb.trim().toUpperCase(),carrier:r,...t.needed_by?{needed_by:t.needed_by}:{},...t.label?{label:t.label}:{}}).watch_id}}async function bJ(){return ga.listWatches()}async function BJ(t){return{removed:ga.removeWatch(t.watch_id)}}async function QJ(t){let e=t.watch_id?ga.getWatch(t.watch_id):void 0;if(t.watch_id&&!e)throw new Error(`Watch ${t.watch_id} was not found.`);let r=e?[e]:ga.listWatches(),n=new Date().toISOString(),i=0,s=0,o=[];for(let a of r)try{let u=await Hu({awb:a.awb,...a.carrier!=="unknown"?{carrier:a.carrier}:{},...a.needed_by?{needed_by:a.needed_by}:{}}),c=wE(u),A=a.last_status!==u.status||a.last_phase!==u.normalized_phase||a.last_location!==u.current_location||a.last_scan_at!==u.last_scan_at;A&&(i+=1);let l={watchId:a.watch_id,status:u.status,checkedAt:n,consecutiveFailures:0};u.normalized_phase&&(l.phase=u.normalized_phase),u.current_location&&(l.location=u.current_location),u.last_scan_at&&(l.lastScanAt=u.last_scan_at),l.reasoning=u.reasoning,u.status==="unknown"&&(l.error=u.reasoning),A?l.changedAt=n:a.last_change_at&&(l.changedAt=a.last_change_at),ga.updateWatchStatus(l),o.push({watch_id:a.watch_id,awb:a.awb,carrier:a.carrier,...a.label?{label:a.label}:{},checked_at:n,changed:A,status:u,anomalies:c})}catch(u){s+=1;let c=u instanceof Error?u.message:"Unknown refresh failure";ga.updateWatchFailure({watchId:a.watch_id,checkedAt:n,error:c,consecutiveFailures:(a.consecutive_failures??0)+1}),o.push({watch_id:a.watch_id,awb:a.awb,carrier:a.carrier,...a.label?{label:a.label}:{},checked_at:n,changed:!1,anomalies:[],error:c})}return dr.recordWatchRefresh({checked:o.length,changed:i,failures:s},n),{refreshed_at:n,watches:o}}var si=new Om({name:"indian-parcel-mcp",version:"0.1.
|
|
255
|
+
`);let e=this.db.prepare("PRAGMA table_info(watches)").all(),r=new Set(e.map(i=>i.name)),n=[["last_phase","ALTER TABLE watches ADD COLUMN last_phase TEXT"],["last_location","ALTER TABLE watches ADD COLUMN last_location TEXT"],["last_scan_at","ALTER TABLE watches ADD COLUMN last_scan_at TEXT"],["last_reasoning","ALTER TABLE watches ADD COLUMN last_reasoning TEXT"],["last_error","ALTER TABLE watches ADD COLUMN last_error TEXT"],["last_change_at","ALTER TABLE watches ADD COLUMN last_change_at TEXT"],["consecutive_failures","ALTER TABLE watches ADD COLUMN consecutive_failures INTEGER NOT NULL DEFAULT 0"]];for(let[i,s]of n)r.has(i)||this.db.exec(s)}},ga=new rk;async function yJ(t){let e=Jc(t.awb),r=e.carrier==="unknown"?"unknown":e.carrier;return{watch_id:ga.addWatch({awb:t.awb.trim().toUpperCase(),carrier:r,...t.needed_by?{needed_by:t.needed_by}:{},...t.label?{label:t.label}:{}}).watch_id}}async function bJ(){return ga.listWatches()}async function BJ(t){return{removed:ga.removeWatch(t.watch_id)}}async function QJ(t){let e=t.watch_id?ga.getWatch(t.watch_id):void 0;if(t.watch_id&&!e)throw new Error(`Watch ${t.watch_id} was not found.`);let r=e?[e]:ga.listWatches(),n=new Date().toISOString(),i=0,s=0,o=[];for(let a of r)try{let u=await Hu({awb:a.awb,...a.carrier!=="unknown"?{carrier:a.carrier}:{},...a.needed_by?{needed_by:a.needed_by}:{}}),c=wE(u),A=a.last_status!==u.status||a.last_phase!==u.normalized_phase||a.last_location!==u.current_location||a.last_scan_at!==u.last_scan_at;A&&(i+=1);let l={watchId:a.watch_id,status:u.status,checkedAt:n,consecutiveFailures:0};u.normalized_phase&&(l.phase=u.normalized_phase),u.current_location&&(l.location=u.current_location),u.last_scan_at&&(l.lastScanAt=u.last_scan_at),l.reasoning=u.reasoning,u.status==="unknown"&&(l.error=u.reasoning),A?l.changedAt=n:a.last_change_at&&(l.changedAt=a.last_change_at),ga.updateWatchStatus(l),o.push({watch_id:a.watch_id,awb:a.awb,carrier:a.carrier,...a.label?{label:a.label}:{},checked_at:n,changed:A,status:u,anomalies:c})}catch(u){s+=1;let c=u instanceof Error?u.message:"Unknown refresh failure";ga.updateWatchFailure({watchId:a.watch_id,checkedAt:n,error:c,consecutiveFailures:(a.consecutive_failures??0)+1}),o.push({watch_id:a.watch_id,awb:a.awb,carrier:a.carrier,...a.label?{label:a.label}:{},checked_at:n,changed:!1,anomalies:[],error:c})}return dr.recordWatchRefresh({checked:o.length,changed:i,failures:s},n),{refreshed_at:n,watches:o}}var si=new Om({name:"indian-parcel-mcp",version:"0.1.4"});si.registerTool("track_shipment",{description:"Track an Indian courier shipment by AWB or tracking number and return deadline-aware reasoning. Use this when a user asks to track a package in India, including bare numeric tracking numbers. Auto-detects Blue Dart, DTDC, Delhivery, and India Post when possible, so do not ask for the carrier first unless detection fails.",inputSchema:_S,outputSchema:Tf.shape},async t=>{let e=await Hu(wJ(t));return ki(e)});si.registerTool("track_india_parcel",{description:"Track an India parcel or shipment by AWB or tracking number. Prefer this for India package tracking requests with bare numeric tracking numbers. Auto-detects Blue Dart, DTDC, Delhivery, and India Post when possible.",inputSchema:_S,outputSchema:Tf.shape},async t=>{let e=await Hu(wJ(t));return ki(e)});si.registerTool("detect_carrier",{description:"Detect the most likely Indian carrier for an AWB or tracking number. Use this for India shipment numbers when the carrier is unknown instead of guessing from non-India couriers.",inputSchema:NS,outputSchema:{carrier:v(),confidence:Re(),alternatives:be(Z({carrier:v(),confidence:Re()}))}},async t=>{let e=await xS(t);return ki(e)});si.registerTool("detect_india_carrier",{description:"Detect the likely Indian courier for an AWB or tracking number. Prefer this for India parcel requests when the carrier is not given.",inputSchema:NS,outputSchema:{carrier:v(),confidence:Re(),alternatives:be(Z({carrier:v(),confidence:Re()}))}},async t=>{let e=await xS(t);return ki(e)});si.registerTool("estimate_eta",{description:"Estimate delivery windows between two India PIN codes for supported Indian carriers.",inputSchema:C8,outputSchema:{p50_hours:Re(),p90_hours:Re(),basis:Zt(["historical_data","heuristic","default"])}},async t=>{let e=await EJ(Oke(t));return ki(e)});si.registerTool("diagnose_shipment",{description:"Track an Indian shipment, detect anomalies, and produce escalation guidance. Use this after tracking when the shipment looks delayed, stuck, or exception-prone.",inputSchema:y8,outputSchema:{status:Tf,anomalies:be(DS),escalation_playbook:be(m8),reasoning:v()}},async t=>{let e=await mJ(Pke(t));return ki(e)});si.registerTool("watch_shipment",{description:"Persist an Indian shipment watch in local SQLite storage for later refresh checks.",inputSchema:b8,outputSchema:{watch_id:v().uuid()}},async t=>{let e=await yJ(Hke(t));return ki(e)});si.registerTool("list_watches",{description:"List all locally persisted watched Indian shipments.",outputSchema:{watches:be(E8)}},async()=>{let t=await bJ();return ki({watches:t})});si.registerTool("refresh_watches",{description:"Refresh one watched Indian shipment or all watches and persist monitoring state.",inputSchema:Q8,outputSchema:{refreshed_at:v(),watches:be(I8)}},async t=>{let e=await QJ({...t.watch_id?{watch_id:t.watch_id}:{}});return ki(e)});si.registerTool("remove_watch",{description:"Remove a watched Indian shipment from local SQLite storage.",inputSchema:B8,outputSchema:{removed:St()}},async t=>{let e=await BJ(t);return ki(e)});si.registerTool("get_observability",{description:"Return a lightweight health snapshot for carrier failures, parser drift, and watch refresh activity.",outputSchema:oE.shape},async()=>ki(dr.snapshot()));function ki(t){return{content:[{type:"text",text:JSON.stringify(t,null,2)}],structuredContent:t}}function wJ(t){return{awb:t.awb,...t.carrier?{carrier:t.carrier}:{},...t.needed_by?{needed_by:t.needed_by}:{},...t.purpose?{purpose:t.purpose}:{},...t.origin_pincode?{origin_pincode:t.origin_pincode}:{},...t.destination_pincode?{destination_pincode:t.destination_pincode}:{}}}function Oke(t){return{carrier:t.carrier,origin_pincode:t.origin_pincode,destination_pincode:t.destination_pincode,...t.service_type?{service_type:t.service_type}:{}}}function Pke(t){return{awb:t.awb,...t.carrier?{carrier:t.carrier}:{},...t.needed_by?{needed_by:t.needed_by}:{},...t.purpose?{purpose:t.purpose}:{}}}function Hke(t){return{awb:t.awb,...t.needed_by?{needed_by:t.needed_by}:{},...t.label?{label:t.label}:{}}}async function $ke(){let t=new Hm;await si.connect(t),Qo.info("indian-parcel-mcp server started on stdio")}$ke().catch(t=>{Qo.error({err:t},"Fatal server error"),process.exit(1)});
|