# MCP Server

Gives AI assistants access to the Deluxe developer documentation and OpenAPI definitions.

The server exposes two MCP tools. Together they let an assistant discover APIs, read endpoint details and search the docs.

| MCP tool | Purpose |
|  --- | --- |
| `describe-tools` | Returns the TypeScript signatures of the sandbox tools. Call it before your first `execute`. |
| `execute` | Runs JavaScript in a sandbox that can call the documentation tools. |


The sandbox has no `fetch`, `console`, `require` or Node.js APIs. All I/O goes through the global `tools` object.

### Connect

Add the server to your MCP client config. Verify the URL against your live endpoint before use.

```json
{
  "mcp": {
    "dlx-docs": {
      "type": "http",
      "url": "https://developer.deluxe.com/mcp",
      "enabled": true
    }
  }
}
```

### Sandbox tools

| Tool | Description |
|  --- | --- |
| `listApis` | Lists the documented APIs. Optional `filter`, `page` and `limit`. |
| `getEndpoints` | Lists the endpoints of one API, by `name` or `filePath`. |
| `getEndpointInfo` | Returns parameters, request and response schemas, and examples for one endpoint. |
| `getSecuritySchemes` | Returns the security schemes for an API. |
| `getFullApiDescription` | Returns the complete OpenAPI description. |
| `search` | Full-text search. Optional `product` filter: `Merchant Services` or `Payment Network`. |


### Documented APIs

| API | Product |
|  --- | --- |
| Merchant Services → | Merchant Services |
| Merchant Onboarding → | Merchant Services |
| Invoices → | Merchant Services |
| Reports → | Merchant Services |
| Payables DPN API → | Payment Network |
| Lockbox → | Payment Network |


Merchant Services servers:

- Sandbox: `https://sandbox.api.deluxe.com/dpp/v1`
- Production: `https://api.deluxe.com/dpp/v1`


#### Workflow

1. Call `describe-tools` with only the tools you need.
2. Call `execute` once with a script that chains the tool calls and returns only what you need.


#### Example: Process a sale

```js
const { items } = await tools.listApis({ filter: 'Merchant Services' });
const api = items[0];
const { endpoints, servers } = await tools.getEndpoints({ filePath: api.filePath });

const sale = endpoints.find(
  (e) => e.method.toUpperCase() === 'POST' && e.path === '/payments'
);
const guides = await tools.search({
  query: 'Sale request',
  product: 'Merchant Services',
});

return { servers, sale, guides };
```

Result: `POST /payments` (Create Payment), secured with OIDC, plus the matching SDK guides.

### Related Information

Notes
- When several API definitions share a title, the highest version is used. Pass `filePath` to pick a specific one.
- `search` works best with a single word or short phrase that appears in the docs.
- The `execute` arguments `code` and `description` are both required.