## Directory MCP server

**Beta** — This feature is subject to change. The MCP specification and our implementation may evolve.

The Endpoint Directory MCP server enables AI assistants to search and validate health insurance and healthcare provider endpoints programmatically. Unlike the [patient data MCP server](https://www.flexpa.com/docs/guides/agents), the directory server is **public** and does not require authentication.

Use it to build payer or provider selection flows, validate endpoint support for specific plan types, or let AI agents help users find their health insurance company or healthcare provider.

### Endpoint

```bash
POST https://api.flexpa.com/mcp/directory
```

No authentication required. The directory server is read-only and exposes only public endpoint metadata.

* * *

## Configuration

### Claude Desktop / Claude.ai

Add the directory as a custom connector:

1. Go to Settings → Custom Connectors
2. Click [Add Custom Connector](https://claude.ai/settings/connectors?modal=add-custom-connector)
3. Enter a name (e.g., "Flexpa Directory")
4. Enter the URL: `https://api.flexpa.com/mcp/directory`
5. Click "Connect"

No authorization flow is required — the directory is public.

### Claude Code

CLI.claude/settings.json

```bash
claude mcp add flexpa-directory \
  --transport http \
  https://api.flexpa.com/mcp/directory
```

* * *

## Tools

The directory server provides four tools for discovering and validating endpoints.

### search_endpoints

Search for health insurance payers and healthcare providers by name, brand, acronym, or state.

Returns up to 10 matching endpoints with organization details, connection status, and supported lines of business.

#### Parameters

| Parameter | Type   | Required | Description |
|-----------|--------|----------|-------------|
| query     | string | Yes      | Search query — payer name, provider name, brand, acronym, or state. Examples: "Aetna", "BCBS Illinois", "Mayo Clinic"  |

```json
{
  "name": "search_endpoints",
  "arguments": {
    "query": "Aetna"
  }
}
```

### get_endpoint_details

Get detailed information about a specific endpoint, including supported lines of business with authentication flow info, connection status, and features like inactive member access and 2FA requirements.

#### Parameters

| Parameter      | Type   | Required | Description |
|----------------|--------|----------|-------------|
| endpointId     | string | Yes      | The endpoint ID from `search_endpoints` results |

```json
{
  "name": "get_endpoint_details",
  "arguments": {
    "endpointId": "abc-123"
  }
}
```

### check_lob_support

Validate whether an endpoint supports a specific line of business (plan type) and determine the correct authentication flow.

**Lines of business:**

| Type                   | Flow                  |
|------------------------|-----------------------|
| `medicaid`             | OAuth                 |
| `medicare_advantage`   | OAuth                 |
| `chip`                 | OAuth                 |
| `aca_on_exchange`      | OAuth                 |
| `aca_off_exchange`     | OAuth or Credentials  |
| `employer`             | OAuth or Credentials  |
| `original_medicare`    | Special               |
| `veterans`            | Special               |

#### Parameters

| Parameter      | Type   | Required | Description |
|----------------|--------|----------|-------------|
| endpointId     | string | Yes      | The endpoint ID from `search_endpoints` |
| lineOfBusiness | string | Yes      | One of the line of business types listed above |

```json
{
  "name": "check_lob_support",
  "arguments": {
    "endpointId": "abc-123",
    "lineOfBusiness": "employer"
  }
}
```

The response includes pass/fail validation, the authentication flow type (OAuth or Credentials), and recommended next steps.

### list_endpoints

List all endpoints in the directory, optionally filtered by status or line of business.

#### Parameters

| Parameter | Type   | Description |
|-----------|--------|-------------|
| status     | string | Filter by connection status. Default: `CONNECTED` |
| lobType    | string | Filter by line of business support |
| limit      | number | Maximum results to return (default 50, max 100) |

```json
{
  "name": "list_endpoints",
  "arguments": {
    "lobType": "medicaid",
    "limit": 20
  }
}
```

* * *

## Prompts

The directory server includes three prompts that guide AI assistants through common workflows.

| Prompt             | Description |
|--------------------|-------------|
| `find_insurance`  | Walks through identifying a user's insurer, plan type, and validating endpoint support |
| `find_provider`   | Walks through finding a healthcare provider or medical record system |
| `explore_directory`| Browse all available endpoints with line of business details |

### Prompt invocation

```json
{
  "method": "prompts/get",
  "params": {
    "name": "find_insurance"
  }
}
```

* * *

## Use cases

**AI-powered endpoint selection** — Let an AI assistant guide users through finding their health insurance company (`find_insurance`) or healthcare provider (`find_provider`). The insurance prompt handles BCBS state disambiguation, Medicaid regional plans, and plan type identification automatically.

**Endpoint validation** — Before initiating a patient authorization, validate that the endpoint supports the user's plan type and determine whether to use the OAuth or Credentials flow.

**Directory exploration** — Build tools that help operations teams browse available payer and provider endpoints, filter by line of business, and understand coverage gaps.

* * *

## Next steps

- Browse the [Endpoint Directory](https://www.flexpa.com/docs/network/directory) for endpoint details and connection statuses
- Read the [Agent guide](https://www.flexpa.com/docs/guides/agents) for MCP integration patterns with patient data
- Review [Consent](https://www.flexpa.com/docs/consent) for OAuth and Credentials authorization flows.
