MetorialDocs

Choose between the Metorial SDK, the REST API and plain MCP

Use the SDK when it has an adapter for your framework, plain MCP when your framework has its own MCP client, and the REST API from any other language.

Use the Metorial SDK when it has an adapter for your model SDK or framework. It creates the session, formats the tools and runs the calls. Use a plain MCP connection when your framework brings its own MCP client. Use the REST API from languages other than TypeScript and Python, and to manage resources. All three work on the same sessions and authenticate with the same secret API key, so you can combine them.

What you'll learn

  • Which path fits which stack
  • What each path does for you and what it leaves to you
  • The first command or call for each path

Before you start

Pick a path

You are building withUseGuide
Vercel AI SDK, or the OpenAI, Anthropic, Google or Mistral SDKSDK adapterProvider runtime
LangChain or LangGraph, in TypeScript or PythonSDK adapterLangChain and LangGraph
OpenAI Agents SDK, LlamaIndex, CrewAI, Google ADK, Pydantic AI or AutoGen, in PythonSDK adapterFrameworks
OpenAI Agents SDK in TypeScript, Claude Agent SDK or MastraSDK for the session, then the framework's MCP clientClaude Agent SDK, Mastra
Any other MCP clientREST API for the session, then MCPConnect any MCP client
Go, Java, Ruby or another languageREST APIGetting started with the API
An AI client such as Claude, Cursor or ChatGPT, used by a personA portal's Magic MCP URL, no codeSupported clients

Compare the three

SDKPlain MCPREST API
Packagesmetorial on npm and PyPI, plus an adapter package in TypeScriptAny MCP client libraryNone
Creates the sessionYes, in metorial.connect()No. Create it with the SDK, the REST API or the CLIYes, POST /sessions
Formats tools for the modelYesYour MCP client or framework doesYou do
Runs tool callsYes, through the adapterYour MCP client does, with tools/callYou do
AuthSecret API keySecret API key or the session's client_secret, as a Bearer tokenSecret API key as a Bearer token
Per-user OAuthproviderAuthConfigId in a provider entrySet when the session is createdprovider_auth_config_id in a provider entry
LanguagesTypeScript and PythonAnyAny

Start each path

The SDK path is one call. Every framework guide has a complete program.

import { metorialAiSdk } from '@metorial/ai-sdk';
import Metorial from 'metorial';

let metorial = new Metorial({ apiKey: process.env.METORIAL_API_KEY! });

let session = await metorial.connect({
  adapter: metorialAiSdk(),
  providers: [{ providerDeploymentId: process.env.METORIAL_PROVIDER_DEPLOYMENT_ID! }]
});

console.log(Object.keys(session.tools()).join(', '));
import asyncio
import os

from metorial import Metorial, metorial_openai


async def main():
    metorial = Metorial(api_key=os.environ["METORIAL_API_KEY"])

    session = await metorial.connect(
        adapter=metorial_openai(),
        providers=[
            {"provider_deployment_id": os.environ["METORIAL_PROVIDER_DEPLOYMENT_ID"]}
        ],
    )

    print(", ".join(tool["function"]["name"] for tool in session.tools()))


asyncio.run(main())

For plain MCP, create a session and point your client at its connection_url with the API key as a Bearer token:

metorial-admin sessions create \
  --providers '[{"provider_deployment_id": "pde_your_deployment_id"}]'

For the REST API, send the same request yourself:

curl -X POST https://api.metorial.com/sessions \
  -H "Authorization: Bearer $METORIAL_API_KEY" \
  -H "Metorial-Version: 2026-01-01-magnetar" \
  -H "Content-Type: application/json" \
  -d "{\"providers\": [{\"provider_deployment_id\": \"$METORIAL_PROVIDER_DEPLOYMENT_ID\"}]}"

Next steps