> 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 client

Every client connects the same way: add the server, sign in, verify. The steps for each client live on one page, the client bootstrap at [mcp.mediafier.ai/connect](https://mcp.mediafier.ai/connect). To have an agent set itself up, give it one line:

```
Connect me to Mediafier: follow https://mcp.mediafier.ai/connect
```

The bootstrap covers assistant apps (Claude, ChatGPT), coding agents (Claude Code, Codex), IDEs (Cursor, VS Code, Devin) and your own code. How far each client has been verified is on [Compatibility](/connect/compatibility.md).

| Client                                    | Type                              | Status    | Setup                                                                   |
| ----------------------------------------- | --------------------------------- | --------- | ----------------------------------------------------------------------- |
| Claude Connectors                         | Assistant apps                    | Supported | [Setup steps](https://mcp.mediafier.ai/connect#claude-connector)        |
| ChatGPT                                   | Assistant apps                    | Supported | [Setup steps](https://mcp.mediafier.ai/connect#chatgpt-connector)       |
| Microsoft Copilot Studio                  | Assistant apps                    | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#copilot-studio)          |
| Microsoft 365 Copilot (declarative agent) | Assistant apps                    | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#m365-declarative-agent)  |
| Slackbot                                  | Assistant apps                    | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#slackbot)                |
| Devin (cloud agent)                       | Assistant apps                    | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#devin-cloud)             |
| Meta Muse                                 | Assistant apps                    | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#meta-muse)               |
| Claude Code CLI (HTTP)                    | Coding agents                     | Supported | [Setup steps](https://mcp.mediafier.ai/connect#claude-code-http)        |
| OpenClaw                                  | Coding agents                     | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#openclaw)                |
| Hermes Agent                              | Coding agents                     | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#hermes)                  |
| Codex                                     | Coding agents                     | Supported | [Setup steps](https://mcp.mediafier.ai/connect#codex-cli)               |
| Gemini CLI                                | Coding agents                     | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#gemini-cli)              |
| GitHub Copilot CLI                        | Coding agents                     | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#copilot-cli)             |
| OpenCode                                  | Coding agents                     | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#opencode)                |
| Goose                                     | Coding agents                     | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#goose)                   |
| Muse Code                                 | Coding agents                     | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#muse-code)               |
| Cursor                                    | IDEs                              | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#cursor)                  |
| VS Code (GitHub Copilot MCP)              | IDEs                              | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#vscode-copilot)          |
| Devin (formerly Windsurf)                 | IDEs                              | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#devin)                   |
| Zed                                       | IDEs                              | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#zed)                     |
| Raw MCP (HTTP)                            | Your own code and agent platforms | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#raw-mcp)                 |
| OpenAI Agents SDK                         | Your own code and agent platforms | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#openai-agents-sdk)       |
| Anthropic API (MCP connector)             | Your own code and agent platforms | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#anthropic-mcp-connector) |
| AWS Bedrock AgentCore                     | Your own code and agent platforms | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#aws-agentcore)           |
| Guild                                     | Your own code and agent platforms | Preview   | [Setup steps](https://mcp.mediafier.ai/connect#guild)                   |

Not listed? Any client that accepts a remote MCP server by URL with OAuth can connect: add the endpoint above, then use the client's own sign-in step.

## Build your own client

### Your own code (TypeScript, Python)

Use the official MCP SDKs with an access token from an Agent Credential (see [Authentication & Agent Credentials](/connect/authentication.md)). There is no Mediafier package to install.

TypeScript, with `@modelcontextprotocol/sdk` (1.x):

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";

const transport = new StreamableHTTPClientTransport(
  new URL("https://mcp.mediafier.ai/mcp"),
  { requestInit: { headers: { Authorization: `Bearer ${process.env.MEDIAFIER_TOKEN}` } } },
);
const client = new Client({ name: "my-app", version: "1.0.0" });
await client.connect(transport);

const { tools } = await client.listTools();
console.log(tools.map((t) => t.name));

await client.close();
```

Python, with the `mcp` package (2.x):

```python
import asyncio, os

import httpx2
from mcp import Client
from mcp.client.streamable_http import streamable_http_client


async def main():
    headers = {"Authorization": f"Bearer {os.environ['MEDIAFIER_TOKEN']}"}
    async with httpx2.AsyncClient(headers=headers, timeout=120) as http:
        async with Client(
            streamable_http_client("https://mcp.mediafier.ai/mcp", http_client=http)
        ) as client:
            tools = await client.list_tools()
            print([t.name for t in tools.tools])


asyncio.run(main())
```

Calling a tool is `client.callTool({ name, arguments })` in TypeScript and `client.call_tool(name, arguments)` in Python.

### 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-11-25","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.

### Narrow the catalog

Some harnesses accept a tool catalog and then surface nothing from it. The case we have traced was not size — one tool definition the harness could not accept hid the rest — but narrowing the list works around either cause. Add a `tier` hint to the server URL to narrow what `tools/list` returns:

```
POST https://mcp.mediafier.ai/mcp?tier=1
```

`tier=1` returns a small starter set. `tier=all` returns everything you are authorized for, which is also what you get with no hint at all. The hint applies to `tools/list`; `resources/list` is unaffected.

**The hint narrows the list only — never authorization.** The gateway does not consult the tier on `tools/call`, so a tool left out of the list stays callable by name if your organization can call it, and `search_tools` is in the starter set for finding one. Whether a given harness will call a name it did not receive in `tools/list` is up to that harness — many only invoke what they were listed.

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 — 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) — connect, sign in, first call.
* [Authentication & Agent Credentials](/connect/authentication.md) — sign-in and headless keys.
