# MCP Server
fxapi ships a hosted Model Context Protocol (opens new window) (MCP) server, so AI agents and assistants can call the API as native tools — no SDK or glue code required.
https://api.fxapi.com/mcp
The endpoint speaks the streamable HTTP transport. All requests — including listing the available tools — require your API key, sent as the apikey header. You can get a free API key here (opens new window).
MCP clients that support MCP authorization (OAuth 2.1) can sign in instead of sending a key: see Sign in instead of an API key.
# Connect
Using Claude Code:
claude mcp add --transport http fxapi https://api.fxapi.com/mcp --header "apikey: YOUR_API_KEY"
Or add the server to any MCP-capable client (Claude Desktop, Cursor, VS Code, ...):
{
"mcpServers": {
"fxapi": {
"url": "https://api.fxapi.com/mcp",
"headers": { "apikey": "YOUR_API_KEY" }
}
}
}
# Sign in instead of an API key
MCP clients that support MCP authorization (OAuth 2.1) can connect without pasting a key, for example a custom connector in Claude (Settings → Connectors → Add custom connector, URL https://api.fxapi.com/mcp). Without a key, the endpoint answers 401 with a WWW-Authenticate header that names the protected resource metadata, https://api.fxapi.com/.well-known/oauth-protected-resource/mcp. The authorization server is https://fxapi.com (metadata at https://fxapi.com/.well-known/oauth-authorization-server, endpoints under https://app.fxapi.com/oauth/); clients register dynamically or with a client ID metadata document, and PKCE (S256) is required.
You sign in on app.fxapi.com and approve the connection, as the team's owner or an admin. The access token is a key of your team for 60 minutes, renewed with the refresh token, so tool calls count against your plan like any other request. Disconnect an app at any time under API keys → Connected apps in the dashboard. For your own code, use an API key.
# Available tools
The tools are generated from the same OpenAPI specification (opens new window) that describes the REST API, so they always match the documented endpoints, parameters and responses.
| Tool | Endpoint | Description |
|---|---|---|
getLatest | GET /v1/latest | Latest exchange rates |
getHistorical | GET /v1/historical | Historical exchange rates |
getConvert | GET /v1/convert | Convert a value between currencies |
getRate | GET /v1/rate | Exchange rate of one currency pair |
getMatrix | GET /v1/matrix | Cross rates between several currencies |
getRange | GET /v1/range | Historical exchange rates for a time range |
getOhlc | GET /v1/ohlc | Hourly or daily OHLC candles |
getFluctuation | GET /v1/fluctuation | How rates changed between two dates |
getAverage | GET /v1/average | Average, low and high rates per month, quarter or year |
getCurrencies | GET /v1/currencies | List supported currencies |
getStatus | GET /v1/status | Account quota status |
# Quotas and errors
Tool calls are metered exactly like REST requests: they consume your plan quota and return the same status codes and error responses (401, 422, 429, ...). If a call fails, the tool result contains the API's error message including hints on how to proceed.