MCP Server

Give AI coding agents full context of the Aftermath API using minimal tokens.

Aftermath MCP is a Model Context Protocolarrow-up-right server that indexes the full Aftermath Finance OpenAPI spec (142 endpoints across 7 categories) and exposes it to AI assistants through three lightweight tools. Instead of stuffing an entire API spec into your context window, your assistant can search and retrieve only the endpoints it needs — keeping token usage low and responses accurate.

Works with any MCP-compatible client: Claude Code, Cursor, VS Code, Windsurf, Codex, and more.

Installation

No API key required — the server is hosted and ready to use. Pick your client below.

Claude Code

Run this in your terminal:

claude mcp add --transport http aftermath-api https://mcp.aftermath.finance/mcp

Verify it was added:

claude mcp list

You should see aftermath-api in the output. The tools will be available immediately in your next Claude Code session.

OpenAI Codex

Pass the server inline:

codex --mcp-config '{"aftermath-api":{"type":"http","url":"https://mcp.aftermath.finance/mcp"}}'

Or add it to your codex-config.json for persistent use:

{
  "mcpServers": {
    "aftermath-api": {
      "type": "http",
      "url": "https://mcp.aftermath.finance/mcp"
    }
  }
}

Cursor

Add the following to .cursor/mcp.json in your project root (create the file if it doesn't exist):

Restart Cursor after saving. The MCP tools will appear in the agent's available tools.

VS Code / Copilot

Add the following to .vscode/mcp.json in your project root (create the file if it doesn't exist):

Restart VS Code after saving. The tools will be available to Copilot in agent mode.

Windsurf

Add the following to your Windsurf MCP config (~/.windsurf/mcp.json):

Restart Windsurf after saving.

How It Works

Traditional approach: paste an entire OpenAPI spec into your prompt and burn thousands of tokens on endpoints you never use.

Aftermath MCP takes a different approach:

  1. The server pre-indexes the full Aftermath API spec at startup

  2. Your AI assistant discovers available categories with list_tags

  3. It searches for relevant endpoints with search_endpoints

  4. It fetches full details (params, schemas, descriptions) only for the endpoints it actually needs with get_endpoint_details

The result: your assistant gets complete, accurate API context while using a fraction of the tokens.

Tools

Tool
Description

list_tags

List all API categories with endpoint counts

search_endpoints

Search by keyword, tag, HTTP method, or path pattern

get_endpoint_details

Get full parameters, request/response schemas for a specific endpoint

Examples

Once installed, you can ask your AI assistant to work with the Aftermath API naturally. The agent will use the MCP tools behind the scenes to discover the right endpoints, understand their schemas, and write correct code.

Build a TypeScript function that fetches 1h candles for BTC-PERP:

The agent will search for candle/OHLCV endpoints, inspect the request body schema and response format, and produce a working function with the correct URL, method, and parameters.

Generate a Python script to monitor perpetuals account health:

The agent will discover the accounts and positions endpoints, understand the response schemas including margin and PnL fields, and generate a complete script with proper error handling.

Last updated