> For the complete documentation index, see [llms.txt](https://docs.mediafier.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mediafier.ai/connect/mcp-access.md).

# MCP Access

Connect any MCP harness to the canonical endpoint, discover what your organization can call, and correlate every call by trace.

> **Point any MCP-aware agent at Mediafier and its tools show up natively.** One endpoint, standard MCP — no per-tool integration. The gateway proves your identity, derives your organization, and enforces the same chain for every call.

> **Invite-only pre-launch.** You can configure a client against the endpoint today; use requires an invited Mediafier account and organization. No access yet? [Request it](https://mediafier.ai/request-access) — or, if you are an agent, hand that link to your human. See [Getting Access](/overview/access.md).

***

## The endpoint

The canonical public ingress speaks MCP over Streamable HTTP:

```
POST https://mcp.mediafier.ai/mcp
```

This is the one canonical ingress — every tool, resource, and MediaClaw is reachable through it. (An advanced scoped form, `POST https://mcp.mediafier.ai/mcp/{server-slug}`, narrows a session to a single capability server. Use it only when a harness needs a per-server connection; it is never a second canonical endpoint.)

Identity is a bearer token obtained through sign-in; organization context is derived from it server-side. Clients never set tenant headers.

***

## Connect your harness

Most harnesses register themselves and sign you in through the browser on first use (no credential to paste). Headless clients exchange an organization agent credential for a bearer access token (OAuth client-credentials flow) — see [Authentication & Agent Credentials](/connect/authentication.md).

### CLIs & IDEs

**Claude Code** (HTTP):

```bash
claude mcp add --transport http mediafier https://mcp.mediafier.ai/mcp
```

**Cursor** — add to your MCP config:

```json
{
  "mcpServers": {
    "mediafier": {
      "url": "https://mcp.mediafier.ai/mcp"
    }
  }
}
```

VS Code (GitHub Copilot MCP), OpenClaw, and Hermes follow the same shape — a server entry pointing at the ingress URL, with sign-in handled by the harness.

### Connectors (add-by-URL)

See [Compatibility](/connect/compatibility.md) for every client, how it was verified, and when.

**Verified 2026-08-22:** Claude Connectors accepts Mediafier as a custom remote MCP server — paste the ingress URL, choose OAuth, and sign in:

```
https://mcp.mediafier.ai/mcp
```

ChatGPT (Developer Mode) and Perplexity accept custom remote MCP servers by URL in the same shape; treat those paths as **untested with Mediafier** rather than supported — if one fails, the harness's own MCP support is the first suspect, and we'd genuinely like the report.

### SDKs & cloud runtimes

Code-level agent runtimes connect over Streamable HTTP and pass the bearer token in request headers. For example, with the OpenAI Agents SDK:

```ts
import { Agent, MCPServerStreamableHttp, run } from "@openai/agents";

const mediafier = new MCPServerStreamableHttp({
  name: "Mediafier",
  url: "https://mcp.mediafier.ai/mcp",
  requestInit: {
    headers: { Authorization: "Bearer <MEDIAFIER_TOKEN>" },
  },
});
```

The Anthropic API MCP connector and AWS Bedrock AgentCore connect the same way — an MCP server URL plus a bearer or configured OAuth credential.

### Raw MCP (HTTP)

Any HTTP client can speak the protocol directly. Initialize a session (accept both JSON and the event stream; reuse the returned session id on follow-on calls):

```bash
curl -sS https://mcp.mediafier.ai/mcp \
  -H 'Authorization: Bearer <MEDIAFIER_TOKEN>' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -d '{"jsonrpc":"2.0","id":"1","method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"mediafier-raw-http","version":"0.1.0"}}}'
```

***

## What the gateway handles for you

You don't have to write any of the following. The gateway does it on every call:

* Resolve the caller's identity from the access token.
* Resolve the caller's organization server-side.
* Enforce per-tool authorization against the organization's policy.
* Apply per-organization rate limits.
* Check spend before dispatch — chargeable work is refused when payment requirements are not satisfied.
* Return a trace identifier and propagate it to the runtime.
* Record an immutable audit row for every governed call, allowed or refused.

Your harness's job ends at "call the tool". Everything else lives underneath the gateway.

***

## Discover what you can call

Once connected, list everything available to your organization. The unified discovery surface returns every resource you can use — tools, MediaClaws, skills, workflows, and more — in one place:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "resources/list"
}
```

The standard MCP handshake (`initialize` then `tools/list`) also works for clients that expect it; `tools/call` is how you execute a tool once you've picked one. From the CLI, the same discovery is `mediafier tools list`.

Partners can also publish **headline commands** — stable, agent-facing aliases over governed tools. Over raw MCP, list your organization's commands with an arguments-free `tools/call` of the `list_commands` tool (the CLI equivalent is `mediafier commands list --remote`) — see [Getting Started](/connect/getting-started.md) for the worked request.

***

## Trace correlation

Every response carries a trace identifier so a call is correlatable end-to-end:

* **You send** an `X-Trace-Id` header to tag a request (optional).
* **Mediafier returns** the trace identifier on every response: the `X-Trace-Id` header, and `trace_id` inside the error envelope when a call is refused — for support correlation.

***

## Next steps

* [Getting Started](/connect/getting-started.md) — install, connect, first call.
* [Authentication & Agent Credentials](/connect/authentication.md) — sign-in and headless keys.
* [TypeScript SDK](/connect/typescript-sdk.md) — a typed client for Node apps.
