Installation
Install Spectral
Section titled “Install Spectral”curl -LsSf https://getspectral.sh/install.sh | bashThis installs uv if needed, then installs Spectral in an isolated environment with spectral available in ~/.local/bin/.
Install the MCP server
Section titled “Install the MCP server”Register the Spectral MCP server with your AI client:
spectral mcp installThis 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"] } }}Configure your LLM provider
Section titled “Configure your LLM provider”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:
spectral configFor most APIs, Claude Haiku provides excellent results at the lowest cost. Sonnet and Opus are available if you need higher accuracy on complex APIs.
Install the Chrome extension (optional)
Section titled “Install the Chrome extension (optional)”Only needed if you want to capture your own APIs. Skip this if you only plan to use community tools.
- Install Spectral — API Discovery from the Chrome Web Store
- Connect the extension to the CLI:
spectral extension installNext steps
Section titled “Next steps”- Use community tools — the fastest way to get started
- Capture your own APIs — reverse-engineer any app into MCP tools