Getting Started

Turn your OpenAPI documents into an MCP server and connect your APIs to LLMs in minutes. No custom wrappers and no token bloat—Scalar sits between your API definition and the agent runtime.

From API to agent-ready in three steps

Upload

Add one spec or many—paste a URL or upload directly. Scalar parses, indexes, and augments it for search and execution.

Configure

Create installations, set access, and preconfigure auth (OAuth, API keys, bearer tokens). Agents use your Scalar credentials; your upstream API secrets stay on our execution layer.

Connect

Plug in via MCP URL or the Agent SDK. The model gets three lean tools that pull schema and operation details just in time.

Connect from anywhere

Use the chat at agent.scalar.com, or connect from your own agent runtime or IDE. Create a personal access token under Account → API Keys, then follow the guide for your stack (SDK · MCP).

import asyncio

from scalar_agent import agent_scalar
from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp

async def main() -> None:
    scalar = agent_scalar(token="your-personal-token")
    installation = scalar.installation("your-installation-id")

    server = MCPServerStreamableHttp(**installation.create_openai_mcp())
    await server.connect()

    agent = Agent(name="api-agent", mcp_servers=[server])

    result = await Runner.run(agent, "Which APIs are available that let me create a planet?")
    print(result.final_output)

    await server.cleanup()

asyncio.run(main())

Authentication and access

Configure auth once in the Scalar dashboard—OAuth 2.0, API keys, bearer tokens, or patterns that match your OpenAPI securitySchemes. A private installation, the default, requires a Scalar personal access token or OAuth sign-in, so a shared URL does not leak access by itself. Public installations rely on your API's own authentication instead; see Authentication.

Read more: API Authentication on the MCP page.

Next steps