> ## Documentation Index
> Fetch the complete documentation index at: https://docs.debtstack.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP Integration

> Connect DebtStack to Claude via Model Context Protocol

## Overview

The Model Context Protocol (MCP) allows you to connect DebtStack directly to Claude Desktop, Claude Code, Cursor, and other MCP-compatible clients, giving them access to corporate debt data in natural conversations.

## Installation

```bash theme={null}
pip install debtstack-ai[mcp]
```

This installs the `debtstack-mcp` command-line server and all required dependencies.

## Client Configuration

### Claude Desktop

Add to your Claude Desktop config:

**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`

**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

```json theme={null}
{
  "mcpServers": {
    "debtstack-ai": {
      "command": "debtstack-mcp",
      "env": {
        "DEBTSTACK_API_KEY": "ds_xxxxx"
      }
    }
  }
}
```

### Claude Code

Add to `~/.claude/mcp.json`:

```json theme={null}
{
  "mcpServers": {
    "debtstack-ai": {
      "command": "debtstack-mcp",
      "env": {
        "DEBTSTACK_API_KEY": "ds_xxxxx"
      }
    }
  }
}
```

### Cursor

Add to `.cursor/mcp.json`:

```json theme={null}
{
  "mcpServers": {
    "debtstack-ai": {
      "command": "debtstack-mcp",
      "env": {
        "DEBTSTACK_API_KEY": "ds_xxxxx"
      }
    }
  }
}
```

### Alternative: Python Module

If you prefer not to use the console script, run with `python -m` instead:

```json theme={null}
{
  "mcpServers": {
    "debtstack-ai": {
      "command": "python",
      "args": ["-m", "debtstack.mcp_server"],
      "env": {
        "DEBTSTACK_API_KEY": "ds_xxxxx"
      }
    }
  }
}
```

After saving the configuration, restart your MCP client to load the DebtStack server.

## Available Tools

Once configured, Claude has access to 8 DebtStack tools:

| Tool                      | Description                                                                |
| ------------------------- | -------------------------------------------------------------------------- |
| `search_companies`        | Search companies by ticker, sector, leverage ratio, and risk flags         |
| `search_bonds`            | Search bonds by ticker, seniority, yield, spread, and maturity             |
| `resolve_bond`            | Look up a bond by CUSIP, ISIN, or description (e.g., "RIG 8% 2027")        |
| `get_guarantors`          | Find all entities that guarantee a bond                                    |
| `get_corporate_structure` | Get full parent-subsidiary hierarchy for a company                         |
| `search_pricing`          | Get FINRA TRACE bond prices, YTM, and spreads                              |
| `search_documents`        | Search SEC filing sections (debt footnotes, credit agreements, indentures) |
| `get_changes`             | See what changed in a company's debt structure since a date                |

## Example Conversations

### Leverage Analysis

**You:** Which of the MAG7 companies has the highest leverage?

**Claude:** Let me search for the MAG7 companies and compare their leverage ratios.

*\[Uses search\_companies tool]*

Based on my search, here are the MAG7 companies ranked by net leverage ratio...

***

### Bond Screening

**You:** Find me senior secured bonds yielding more than 8%

**Claude:** I'll search for high-yield secured bonds.

*\[Uses search\_bonds tool]*

I found several bonds matching your criteria. Here are the top results:

* RIG 8.00% Senior Secured Notes due 2027: 9.42% YTM
* ...

***

### Structural Analysis

**You:** Who guarantees Transocean's 8% 2027 notes?

**Claude:** Let me look up that bond and check its guarantee structure.

*\[Uses resolve\_bond tool, then get\_guarantors tool]*

The 8.00% Senior Secured Notes due 2027 (CUSIP: 893830AK8) are guaranteed by 47 entities including Transocean Inc., Transocean Offshore Deepwater Drilling Inc., and Triton Holding Company...

***

### Corporate Structure

**You:** Show me RIG's corporate structure — where does the debt sit?

**Claude:** Let me pull up the full corporate hierarchy.

*\[Uses get\_corporate\_structure tool]*

Transocean Ltd. has 230 entities in its corporate structure. The debt is primarily issued at...

***

### Covenant Research

**You:** What are Charter's leverage covenants?

**Claude:** I'll search Charter's SEC filings for covenant details.

*\[Uses search\_documents tool]*

Based on Charter's credit agreement filings, the key leverage covenants are...

***

### Change Tracking

**You:** What changed in CVS's debt structure since June 2025?

**Claude:** Let me check for recent changes.

*\[Uses get\_changes tool]*

Since June 2025, CVS has had the following changes to its debt structure...

## More Example Queries

Here are additional questions you can ask Claude with the DebtStack MCP server:

* "Which energy companies have near-term maturities and high leverage?"
* "Compare Charter's debt structure to Altice"
* "Find all bonds maturing before 2026 with yield above 7%"
* "What are the change-of-control provisions in Altice's indentures?"
* "Search for restricted payment language in RIG's credit agreements"
* "Which companies in the telecom sector have structural subordination?"
* "How has ORCL's leverage changed since their Cerner acquisition?"

## Troubleshooting

### Server Not Loading

1. Verify the package is installed: `pip show debtstack-ai`
2. Check the console script exists: `debtstack-mcp --help` (should fail with missing API key, not "command not found")
3. Ensure your API key is set correctly in the config
4. Check your MCP client logs for errors

### API Errors

If you see API errors, verify:

1. Your API key is valid (starts with `ds_`)
2. You have credits remaining (check at [debtstack.ai/dashboard](https://debtstack.ai/dashboard))
3. You're not exceeding rate limits (60/min for Pay-as-You-Go, 100/min for Pro)

### Debugging

Enable verbose logging by setting the `DEBUG` environment variable:

```json theme={null}
{
  "mcpServers": {
    "debtstack-ai": {
      "command": "debtstack-mcp",
      "env": {
        "DEBTSTACK_API_KEY": "ds_xxxxx",
        "DEBUG": "true"
      }
    }
  }
}
```

## Next Steps

<CardGroup cols={2}>
  <Card title="API Reference" icon="book" href="/api-reference/overview">
    Full API documentation
  </Card>

  <Card title="LangChain Integration" icon="link" href="/guides/langchain">
    Build agents with LangChain
  </Card>
</CardGroup>
