{"_id":"@abhi-finance/mcp-server-open-api","_rev":"2-37945a321210e94b3f59404f1a7e4727","name":"@abhi-finance/mcp-server-open-api","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@abhi-finance/mcp-server-open-api","version":"1.0.0","keywords":["mcp","open-api","ewa","earned-wage-access","abhi","salary-advance","uae"],"author":{"name":"Abhi"},"license":"MIT","_id":"@abhi-finance/mcp-server-open-api@1.0.0","maintainers":[{"name":"zeus.abhi","email":"zeus@abhi.co"}],"bin":{"mcp-server-open-api":"dist/index.js"},"dist":{"shasum":"904db16f5359c67fe83be494737fd950a75c24ea","tarball":"https://registry.npmjs.org/@abhi-finance/mcp-server-open-api/-/mcp-server-open-api-1.0.0.tgz","fileCount":42,"integrity":"sha512-Nzv8ZGFdEgkKTBCQ3Pva7sCTnRRL+D9Tc2PUqzN8dCnhv3mtfHpJQzZtuZI+/L2Ftlft42TGoHbgOjj6rms/hg==","signatures":[{"sig":"MEUCIQCK1HjEchKVRZK2J71KqEMLMMmu5gQ0oGq3b5jOhNQXWAIgA3/D8drca+zTHCWY8NRkWrmPVzSlIAtNcRkX/aBxcy0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":84248},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"gitHead":"d47da2de3bcb1488b775688e5ab5931115544f60","scripts":{"dev":"tsx src/index.ts","build":"tsc","start":"node dist/index.js","prepublishOnly":"npm run build"},"_npmUser":{"name":"zeus.abhi","email":"zeus@abhi.co"},"_npmVersion":"11.6.2","description":"MCP Server for Abhi Open API (EWA - UAE)","directories":{},"_nodeVersion":"24.12.0","dependencies":{"zod":"^3.23.8","@modelcontextprotocol/sdk":"^1.12.1"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","typescript":"^5.7.0","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/mcp-server-open-api_1.0.0_1783507396636_0.503030162624645","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@abhi-finance/mcp-server-open-api","version":"1.0.1","description":"MCP Server for Abhi Open API (EWA - UAE)","type":"module","main":"dist/index.js","bin":{"mcp-server-open-api":"dist/index.js"},"scripts":{"build":"tsc","start":"node dist/index.js","dev":"tsx src/index.ts","prepublishOnly":"npm run build"},"keywords":["mcp","open-api","ewa","earned-wage-access","abhi","salary-advance","uae"],"author":{"name":"Abhi"},"license":"MIT","engines":{"node":">=18"},"dependencies":{"@modelcontextprotocol/sdk":"^1.12.1","zod":"^3.23.8"},"devDependencies":{"@types/node":"^22.10.0","tsx":"^4.19.0","typescript":"^5.7.0"},"gitHead":"55c717e8038a09c11ab0aeadbc0eb1b5e05d9fd0","types":"./dist/index.d.ts","_id":"@abhi-finance/mcp-server-open-api@1.0.1","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-tK4SfL5Xv+X1E3wFQl4W0SSELZcEKrfENlgfTb3kxUQ+pC2+9qw5kzROhvfybJ/zoZIM1ktWd9cW1YUGj92b9A==","shasum":"4248927d6345aacd3474c778d28e0b8d72a07585","tarball":"https://registry.npmjs.org/@abhi-finance/mcp-server-open-api/-/mcp-server-open-api-1.0.1.tgz","fileCount":42,"unpackedSize":84098,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCID0/iq7y2egJqB9yZhIAkBdrS0DTEXboiZq+U7HHt904AiEA+1BVl8oxdEbaLBAHbSqgfj6ahcBOuq+NX+1k2V/NTIk="}]},"_npmUser":{"name":"zeus.abhi","email":"zeus@abhi.co"},"directories":{},"maintainers":[{"name":"zeus.abhi","email":"zeus@abhi.co"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-server-open-api_1.0.1_1783511191059_0.6366490117959895"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-08T10:43:16.444Z","modified":"2026-07-08T11:46:31.383Z","1.0.0":"2026-07-08T10:43:16.782Z","1.0.1":"2026-07-08T11:46:31.194Z"},"author":{"name":"Abhi"},"license":"MIT","keywords":["mcp","open-api","ewa","earned-wage-access","abhi","salary-advance","uae"],"description":"MCP Server for Abhi Open API (EWA - UAE)","maintainers":[{"name":"zeus.abhi","email":"zeus@abhi.co"}],"readme":"# Abhi Open API MCP Server\n\nMCP (Model Context Protocol) server for the Abhi Open API (EWA - UAE). Exposes all 28 API endpoints as tools that AI agents can invoke through natural language.\n\n## Installation\n\n```bash\nnpm install -g @abhi-finance/mcp-server-open-api\n```\n\nOr use directly with `npx`:\n\n```bash\nnpx @abhi-finance/mcp-server-open-api\n```\n\n### From Source\n\n```bash\nnpm install\nnpm run build\n```\n\n## Getting Credentials\n\nThis MCP server requires API credentials to connect to Abhi's platform. To obtain credentials, please get in touch with the **Abhi UAE team**. They will provide you with:\n\n- API base URL and login URL for your environment (UAT/Production)\n- Username (email) and password\n- MFA setup (if applicable)\n\nWithout valid credentials, the server cannot authenticate with the Abhi API.\n\n## Configuration\n\n### Environment Variables\n\n| Variable               | Required | Description                            |\n| ---------------------- | -------- | -------------------------------------- |\n| `ABHI_API_BASE_URL`    | Yes      | API host (no trailing path)            |\n| `ABHI_API_LOGIN_URL`   | Yes      | Full login endpoint URL                |\n| `ABHI_API_PREFIX`      | Yes      | Path prefix for all API calls          |\n| `ABHI_API_USERNAME`    | Yes      | Login email                            |\n| `ABHI_API_PASSWORD`    | Yes      | Login password                         |\n| `ABHI_API_MFA`         | No       | MFA TOTP code (if MFA enabled)         |\n| `ABHI_API_EMIRATES_ID` | No       | Emirates ID (for employee-level login) |\n\n### Environment Examples\n\n**UAT:**\n\n```\nABHI_API_BASE_URL=https://api-uat-v2.abhi.ae\nABHI_API_LOGIN_URL=https://api-uat-v2.abhi.ae/uat-auth/external/login\nABHI_API_PREFIX=/uat-open-api\n```\n\n## Usage\n\nAdd to your MCP client settings (e.g., `mcp.json` in your workspace):\n\n### Using npx (recommended after npm install)\n\n```json\n{\n  \"mcpServers\": {\n    \"abhi-open-api\": {\n      \"command\": \"npx\",\n      \"args\": [\"@abhi-finance/mcp-server-open-api\"],\n      \"env\": {\n        \"ABHI_API_BASE_URL\": \"https://api-uat-v2.abhi.ae\",\n        \"ABHI_API_LOGIN_URL\": \"https://api-uat-v2.abhi.ae/uat-auth/external/login\",\n        \"ABHI_API_PREFIX\": \"/uat-open-api\",\n        \"ABHI_API_USERNAME\": \"your-email@abhi.ae\",\n        \"ABHI_API_PASSWORD\": \"your-password\"\n      }\n    }\n  }\n}\n```\n\n### Using local path\n\n```json\n{\n  \"mcpServers\": {\n    \"abhi-open-api\": {\n      \"command\": \"node\",\n      \"args\": [\"/full/path/to/open-api-mcp/dist/index.js\"],\n      \"env\": {\n        \"ABHI_API_BASE_URL\": \"https://api-uat-v2.abhi.ae\",\n        \"ABHI_API_LOGIN_URL\": \"https://api-uat-v2.abhi.ae/uat-auth/external/login\",\n        \"ABHI_API_PREFIX\": \"/uat-open-api\",\n        \"ABHI_API_USERNAME\": \"your-email@abhi.ae\",\n        \"ABHI_API_PASSWORD\": \"your-password\"\n      }\n    }\n  }\n}\n```\n\nAfter saving, reconnect MCP servers in your IDE.\n\n## Available Tools (28)\n\n### 1. Authentication\n\n- `login` — Authenticate and obtain JWT token (24hr validity)\n\n### 2. Employee Management\n\n- `employees_operation` — Unified create/update/balance endpoint (upsert by emiratesId)\n- `get_all_employees` — List employees with pagination and filters\n- `add_employees` — Batch create employees\n- `update_employees` — Batch update employees (bankId required in payload)\n- `delete_employees` — Soft-delete by Emirates ID\n- `employee_eligibility_check` — Pre-onboarding eligibility assessment\n\n### 3. Transaction Operations\n\n- `validate_employee_transaction` — Pre-transaction fee check (employer token)\n- `validate_transaction_employee_token` — Pre-transaction check (employee token)\n- `create_transaction` — Create EWA/Salary Advance transaction\n- `post_transaction_employee_token` — Post transaction (employee token)\n- `get_transaction_status` — Get status and signed agreement URL\n- `get_all_transactions` — List all org transactions with filters\n- `get_employee_transaction_history` — Employee transaction history (employee token)\n- `get_monthly_balance` — Employee available balance (employee token)\n- `cancel_transaction` — Cancel transaction (irreversible)\n\n### 4. Repayment\n\n- `get_outstanding_balance` — Outstanding repayment info by Emirates ID\n- `post_repayment` — Submit loan repayment (enters PENDING state)\n\n### 5. Organization Management\n\n- `get_all_sub_organizations` — List sub-organizations\n- `create_sub_organization` — Create sub-organization\n\n### 6. Reference Data\n\n- `get_all_banks` — Bank directory (use bank IDs when creating employees)\n- `get_all_business_types` — Business type directory\n- `get_media_signed_url` — Pre-signed S3 upload/download URL\n\n### 7. Assessment & Verification\n\n- `validate_questions_key_value` — Financial assessment (A1-A4 format)\n- `validate_questions_array` — Financial assessment (dynamic questions)\n\n### 8. Term Loans\n\n- `check_term_loan_eligibility` — Check eligibility, returns trackingId\n- `create_term_loan` — Create term loan (requires trackingId from eligibility)\n- `repay_term_loan` — Submit term loan repayment\n- `get_active_term_loan` — Get active loans with schedules\n\n## Important Notes\n\n### Mawarid-Enabled Organizations\n\nIf the organization has Mawarid enabled, employee creation requires additional fields:\n\n- `emiratesIdExpiryDate`, `emiratesIdNationality`, `emiratesIdDateOfBirth`, `emiratesIdFullName`, `emiratesIdGender`, `emiratesIdCardNumber`, `emiratesIdIdentificationNumber`\n- `acceptedTnCs`, `providedInformationConsent`, `KFSConsent`\n- `fullName`, `employerName`, `doYouIdentifyAsAPersonOfDetermination`\n- `basicIncome`, `customerIBAN`, `areYouAPoliticallyExposedPerson`, `street1`\n- `mxDocuments` — array with format: `[{label: \"Emirates ID Front\", filePath: \"url\"}, {label: \"Emirates ID Back\", filePath: \"url\"}]`\n\n### API-Specific Requirements\n\n- **update_employees**: `bankId` is mandatory in the payload (server returns 500 without it)\n- **validate_employee_transaction**: Include `confirmPromiseToPurchase: true` if Mawarid/promise-to-purchase is enabled\n- **create_transaction**: Include `agreementAccepted: true` on Mawarid-enabled orgs\n- **employee_eligibility_check**: All date fields must be ISO 8601 format (e.g., `\"2025-11-30T00:00:00.000Z\"`)\n- **create_term_loan**: Must call `check_term_loan_eligibility` first and pass the `trackingId` from its response\n- **Employee-level endpoints** (history, balance, validate/post by employee token): Require login with `emiratesId` to get an employee-level token\n\n## Auth Flow\n\nThe server handles authentication transparently:\n\n1. On first API call, it logs in using configured credentials\n2. JWT token is cached in memory\n3. Token is auto-refreshed 5 minutes before expiry\n4. No manual login step needed\n\n## Architecture\n\n```\nAI Agent ──stdio──▶ MCP Server (Node.js) ──HTTPS──▶ Abhi API (AWS)\n```\n\n- Communication: JSON-RPC over stdin/stdout\n- Auth: JWT Bearer token (auto-managed)\n- Validation: Zod schemas on all inputs\n- Runtime: Node.js ES Modules\n\n## Project Structure\n\n```\nopen-api-mcp/\n├── src/\n│   ├── index.ts              # Entry point\n│   ├── http-client.ts        # HTTP client with auto-auth\n│   └── tools/\n│       ├── auth.ts           # login\n│       ├── employees.ts      # 6 employee tools\n│       ├── transactions.ts   # 9 transaction tools\n│       ├── repayments.ts     # 2 repayment tools\n│       ├── organizations.ts  # 2 org tools\n│       ├── reference.ts      # 3 reference data tools\n│       ├── assessment.ts     # 2 assessment tools\n│       └── term-loans.ts     # 4 term loan tools\n├── openapi.yaml              # OpenAPI 3.0.3 spec\n├── package.json\n├── tsconfig.json\n└── dist/                     # Compiled output\n```\n\n## Security\n\n- Credentials stored in environment variables only (never in code)\n- Token cached in process memory (not persisted to disk)\n- Server runs locally — communication is stdio, no network exposure\n- Each user needs their own credentials configured\n\n## OpenAPI Spec\n\nThe full OpenAPI 3.0.3 specification is available at `openapi.yaml` in this directory.\n","readmeFilename":"README.md"}