@ibanchecker/mcp
Advanced tools
+1
-1
| { | ||
| "name": "@ibanchecker/mcp", | ||
| "version": "1.1.2", | ||
| "version": "1.2.0", | ||
| "mcpName": "io.github.koraykoylu/ibanchecker-mcp", | ||
@@ -5,0 +5,0 @@ "description": "MCP server for ibanchecker.cash: IBAN validation, extraction, format specs and BIC/SWIFT lookup tools for AI assistants", |
+105
-16
@@ -5,3 +5,3 @@ import { z } from "zod"; | ||
| export const SERVER_INFO = { name: "ibanchecker-mcp", version: "1.1.2" }; | ||
| export const SERVER_INFO = { name: "ibanchecker-mcp", version: "1.2.0" }; | ||
@@ -48,37 +48,126 @@ export function makeCall(getHeaders) { | ||
| const READ_ONLY_ANNOTATIONS = { | ||
| readOnlyHint: true, | ||
| destructiveHint: false, | ||
| idempotentHint: true, | ||
| openWorldHint: true, | ||
| }; | ||
| export function registerTools(server, call) { | ||
| server.tool( | ||
| server.registerTool( | ||
| "validate_iban", | ||
| "Validate an IBAN number and return its country, format validity, check digit result, and bank details if available.", | ||
| { iban: z.string().describe("The IBAN to validate") }, | ||
| { | ||
| title: "Validate IBAN", | ||
| description: | ||
| "Validate a single International Bank Account Number (IBAN) against the official ISO 13616 structure for its country.\n\n" + | ||
| "What it checks: the country code, total length for that country, the national BBAN structure, and the MOD-97 check digits. " + | ||
| "When the bank/branch code maps to a known institution, the response also includes the bank name, BIC/SWIFT code, and country.\n\n" + | ||
| "Returns JSON with fields such as `valid` (boolean), `countryCode`, `checkDigitsValid`, the `formatted` IBAN, and an optional `bank` object. " + | ||
| "On a malformed input the call still succeeds with `valid: false` and a `reason` (e.g. INVALID_FORMAT, INVALID_CHECKSUM); it does not throw for invalid IBANs.\n\n" + | ||
| "Use this when you have one account number to verify. For many IBANs prefer `validate_bulk_ibans`; to pull IBANs out of prose use `extract_ibans_from_text` first. " + | ||
| "No account data is stored; validation runs in memory and is discarded.", | ||
| inputSchema: { | ||
| iban: z | ||
| .string() | ||
| .min(5) | ||
| .describe( | ||
| "A single IBAN to validate. Case-insensitive; spaces are tolerated and ignored (e.g. 'DE89 3704 0044 0532 0130 00' or 'GB29NWBK60161331926819')." | ||
| ), | ||
| }, | ||
| annotations: READ_ONLY_ANNOTATIONS, | ||
| }, | ||
| ({ iban }) => call("/validate", { method: "POST", body: JSON.stringify({ iban }) }) | ||
| ); | ||
| server.tool( | ||
| server.registerTool( | ||
| "validate_bulk_ibans", | ||
| "Validate up to 100 IBAN numbers at once.", | ||
| { ibans: z.array(z.string()).max(100).describe("Array of IBANs to validate (max 100)") }, | ||
| { | ||
| title: "Validate Multiple IBANs", | ||
| description: | ||
| "Validate a batch of up to 100 IBANs in one call, applying the same ISO 13616 checks as `validate_iban` (country, length, BBAN structure, MOD-97).\n\n" + | ||
| "Returns a JSON array of per-IBAN results in the same order as the input, each with `valid`, `countryCode`, an optional `reason` for failures, and bank details when the code is recognized, plus a summary count of valid vs. invalid entries.\n\n" + | ||
| "Use this instead of calling `validate_iban` in a loop when checking a list (e.g. a payment file or a column of supplier accounts). Split inputs larger than 100 into multiple calls. " + | ||
| "Account numbers are validated in memory and never stored.", | ||
| inputSchema: { | ||
| ibans: z | ||
| .array(z.string().min(5)) | ||
| .min(1) | ||
| .max(100) | ||
| .describe( | ||
| "Array of 1 to 100 IBAN strings to validate. Case-insensitive; spaces are tolerated. Order is preserved in the response." | ||
| ), | ||
| }, | ||
| annotations: READ_ONLY_ANNOTATIONS, | ||
| }, | ||
| ({ ibans }) => call("/validate/bulk", { method: "POST", body: JSON.stringify({ ibans }) }) | ||
| ); | ||
| server.tool( | ||
| server.registerTool( | ||
| "extract_ibans_from_text", | ||
| "Extract and validate all IBAN numbers found in a block of text.", | ||
| { text: z.string().describe("The text to scan for IBANs") }, | ||
| { | ||
| title: "Extract IBANs From Text", | ||
| description: | ||
| "Scan a free-form block of text and pull out every candidate IBAN, then validate each one.\n\n" + | ||
| "Useful for unstructured sources such as emails, invoices, PDFs pasted as text, or chat messages where IBANs appear inline and may be split by spaces or surrounded by other words. " + | ||
| "Returns a JSON array of the IBANs found, each with its validation result (`valid`, `countryCode`, bank details when known); text containing no IBAN returns an empty list rather than an error.\n\n" + | ||
| "Use this as the first step when the account number is buried in prose; pass the extracted IBANs to `validate_bulk_ibans` only if you need to re-check them separately. Input text is processed in memory and not stored.", | ||
| inputSchema: { | ||
| text: z | ||
| .string() | ||
| .min(1) | ||
| .describe( | ||
| "Arbitrary text to scan for IBANs, e.g. the body of an email or invoice. IBANs may be split across spaces or embedded in sentences." | ||
| ), | ||
| }, | ||
| annotations: READ_ONLY_ANNOTATIONS, | ||
| }, | ||
| ({ text }) => call("/extract", { method: "POST", body: JSON.stringify({ text }) }) | ||
| ); | ||
| server.tool( | ||
| server.registerTool( | ||
| "get_iban_format", | ||
| "Get the IBAN format specification for a given country.", | ||
| { country_code: z.string().length(2).describe("Two-letter ISO 3166-1 country code (e.g. DE, GB, FR)") }, | ||
| { | ||
| title: "Get Country IBAN Format", | ||
| description: | ||
| "Return the IBAN format specification for a country, covering 90 supported IBAN-using countries.\n\n" + | ||
| "Returns JSON describing the country's total IBAN length, the BBAN layout (bank code, branch code, and account number positions and lengths), an example IBAN, and the SEPA-membership flag. " + | ||
| "Use this to understand or display how a country's IBAN is structured, to build input masks, or to explain a validation failure, not to validate a specific number (use `validate_iban` for that). " + | ||
| "An unsupported or unknown country code returns an error result describing the problem.", | ||
| inputSchema: { | ||
| country_code: z | ||
| .string() | ||
| .length(2) | ||
| .regex(/^[A-Za-z]{2}$/) | ||
| .describe( | ||
| "Two-letter ISO 3166-1 alpha-2 country code, case-insensitive (e.g. 'DE' for Germany, 'GB' for the United Kingdom, 'FR' for France)." | ||
| ), | ||
| }, | ||
| annotations: READ_ONLY_ANNOTATIONS, | ||
| }, | ||
| ({ country_code }) => call(`/formats/${country_code.toUpperCase()}`) | ||
| ); | ||
| server.tool( | ||
| server.registerTool( | ||
| "lookup_bic", | ||
| "Look up a bank by BIC/SWIFT code.", | ||
| { bic: z.string().describe("The BIC/SWIFT code to look up (e.g. DEUTDEDB)") }, | ||
| { | ||
| title: "Look Up Bank by BIC/SWIFT", | ||
| description: | ||
| "Look up a financial institution by its BIC (Business Identifier Code, also called SWIFT code) and return the matching bank's details.\n\n" + | ||
| "Accepts an 8-character (head office) or 11-character (branch) BIC. Returns JSON with the bank name, city, ISO country code, SEPA membership, and (when available) the official website and Wikidata entity. " + | ||
| "Use this to resolve a BIC to a human-readable bank, to confirm a SWIFT code is real, or to enrich a validated IBAN with institution details. " + | ||
| "An unknown or malformed BIC returns an error result rather than a guess; codes are never fabricated.", | ||
| inputSchema: { | ||
| bic: z | ||
| .string() | ||
| .min(8) | ||
| .max(11) | ||
| .regex(/^[A-Za-z0-9]{8}([A-Za-z0-9]{3})?$/) | ||
| .describe( | ||
| "An 8- or 11-character ISO 9362 BIC/SWIFT code, case-insensitive (e.g. 'DEUTDEFF' or 'DEUTDEFF500')." | ||
| ), | ||
| }, | ||
| annotations: READ_ONLY_ANNOTATIONS, | ||
| }, | ||
| ({ bic }) => call(`/swift/${bic.toUpperCase()}`) | ||
| ); | ||
| } |
14266
55.28%173
103.53%