# Use Spectra with AI Agents



Spectra runs a hosted [MCP](https://modelcontextprotocol.io) server that gives AI
assistants live Spectra data: fixed rates, yield opportunities, markets,
MetaVaults and wallet positions on every network Spectra supports. It needs no
account or API key.

The server reads data and, on a separate endpoint, prepares **unsigned**
transactions. It never signs or sends anything: you review and sign every
transaction in your own wallet.

## Endpoints [#endpoints]

| Endpoint                  | URL                                     | What it does                                                    |
| ------------------------- | --------------------------------------- | --------------------------------------------------------------- |
| Read-only                 | `https://mcp.spectra.finance/mcp`       | Markets, yields, MetaVaults, portfolios, history and these docs |
| With transaction builders | `https://mcp.spectra.finance/mcp/trade` | The above, plus unsigned PT buy, sell and redeem transactions   |

Use the read-only endpoint unless you want the assistant to prepare transactions.

## Connect an assistant [#connect-an-assistant]

**Claude:** open **Customize → Connectors**, choose **Add custom connector**,
name it Spectra and paste the read-only URL.

**Claude Code:** add the server, or install the plugin, which also adds two
Spectra skills.

```bash
claude mcp add --transport http spectra https://mcp.spectra.finance/mcp
```

```text
/plugin marketplace add perspectivefi/spectra-ai
/plugin install spectra@spectra-ai
```

**ChatGPT and other clients:** add a remote MCP server (custom connector) with
the read-only URL and no authentication.

**Cursor and clients that read an `mcpServers` config:**

```json
{ "mcpServers": { "spectra": { "type": "http", "url": "https://mcp.spectra.finance/mcp" } } }
```

[mcp.spectra.finance](https://mcp.spectra.finance) has one-click installs for
Cursor and VS Code. The [Spectra plugin](https://github.com/perspectivefi/spectra-ai)
also works in Codex and Cursor.

**On your computer:** with Node.js 20 or later,
`npx -y @perspectivefi/spectra-mcp` runs the same server locally over stdio
(`--read-only` keeps only the data tools). The package also installs a
`spectra` command-line tool that prints tables or JSON.

## Try it [#try-it]

* "What are the best fixed rates on USDC on Spectra right now?"
* "Compare Spectra's ETH fixed rates with at least three months to maturity."
* "Show me the Spectra sjEUR market and how its implied APY moved this month."
* "What Spectra positions does this wallet hold?" followed by a public address
* "How do Principal Tokens work?"

## Tools [#tools]

| Tool                         | What it does                                                                                                                 |
| ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `spectra_find_yields`        | Ranks fixed rates (PT), LP and MetaVault yields across networks, filtered by asset, network, product, liquidity and maturity |
| `spectra_get_market`         | Fixed, implied, variable and LP APY, maturity, liquidity, volume and app links for one market                                |
| `spectra_get_market_history` | Implied-APY or volume history for one market                                                                                 |
| `spectra_get_metavault`      | A MetaVault's curator, strategy, live and 30-day APY, fees and allocations, or the list of all MetaVaults                    |
| `spectra_get_portfolio`      | A wallet's PT, YT, LP and MetaVault positions with USD values and suggested next steps                                       |
| `spectra_protocol_info`      | Concepts, risks, networks and links to these docs                                                                            |
| `spectra_prepare_pt_trade`   | Trade endpoint only. A quote, then unsigned approval and router transactions to buy or sell PT                               |
| `spectra_prepare_redeem`     | Trade endpoint only. Unsigned transactions to redeem PT after maturity                                                       |

## Safety [#safety]

* **Never signs or sends.** Transaction tools return steps for your wallet to sign.
* **Pinned routers.** Transactions are only built for the Spectra router of each network.
* **Quote check.** Quotes are compared with the market's PT price, and quotes far from it are refused.
* **Exact approvals.** Token approvals cover the exact amount, and none is requested when your allowance already covers it.
* **Data-quality flags.** Thin, near-maturity or anomalous markets are flagged, and rankings hide thin or anomalous ones unless you ask for them.
* **Tokenized-equity markets** are not offered through the hosted server.

## Reading the rates [#reading-the-rates]

APYs are reported as percentages, with the time they were read. A fixed rate
holds only if you keep the PT until maturity; selling earlier gives you the
market price at that time. Variable, LP and MetaVault APYs change over time.

<Callout type="warn">
  No rate is guaranteed, and nothing an assistant tells you is financial advice.
  Check the market in the Spectra app before you confirm a transaction.
</Callout>

## More [#more]

* [Plugin and skills](https://github.com/perspectivefi/spectra-ai) for Claude Code, Codex and Cursor
* [npm package](https://www.npmjs.com/package/@perspectivefi/spectra-mcp): local server and command-line tool
* [Spectra API](https://api.spectra.finance/api-docs), which the server reads
* MCP Registry name: `finance.spectra/mcp`
* [Risk documentation](../security/risk-documentation)
