Skip to content

Installation

Terminal window
curl -LsSf https://getspectral.sh/install.sh | bash

This installs uv if needed, then installs Spectral in an isolated environment with spectral available in ~/.local/bin/.

Register the Spectral MCP server with your AI client:

Terminal window
spectral mcp install

This auto-detects Claude Desktop and Claude Code and registers the server with each. Use --target claude-desktop or --target claude-code to install to a specific client only.

For other MCP clients, add a stdio server entry with the command spectral mcp stdio. For example, in a JSON config file:

{
"mcpServers": {
"spectral": {
"command": "spectral",
"args": ["mcp", "stdio"]
}
}
}

Spectral uses an LLM for API analysis. It supports Anthropic, OpenAI, OpenRouter, and Ollama.

On first use of any analyze command, an interactive prompt guides you through provider selection, API key entry, and model choice. You can also run it manually at any time:

Terminal window
spectral config

For most APIs, Claude Haiku provides excellent results at the lowest cost. Sonnet and Opus are available if you need higher accuracy on complex APIs.

Only needed if you want to capture your own APIs. Skip this if you only plan to use community tools.

  1. Install Spectral — API Discovery from the Chrome Web Store
  2. Connect the extension to the CLI:
Terminal window
spectral extension install