> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metaphi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect an MCP server

> Add a Metaphi AI MCP server to Claude Code, Codex, Cursor, VS Code or Hum, and sign in.

| Server | URL |
| - | - |
| `harwell` | `https://harwell.metaphi.ai/mcp/` |
| `kennet` | `https://kennet.metaphi.ai/mcp/` |

The examples add `harwell`. For another server, change the name and the URL.

## Add the server and sign in

> [tab] Claude Code
>
> ```sh theme={"dark"}
> claude mcp add --transport http harwell https://harwell.metaphi.ai/mcp/
> ```
>
> Then, in a session, run `/mcp`, pick `harwell` and choose **Authenticate**.

> [tab] Codex
>
> Add to `~/.codex/config.toml`:
>
> ```toml theme={"dark"}
> [mcp_servers.harwell]
> url = "https://harwell.metaphi.ai/mcp/"
> ```
>
> Then sign in:
>
> ```sh theme={"dark"}
> codex mcp login harwell
> ```

> [tab] Cursor
>
> Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` in a project:
>
> ```json theme={"dark"}
> {
>   "mcpServers": {
>     "harwell": {
>       "url": "https://harwell.metaphi.ai/mcp/"
>     }
>   }
> }
> ```
>
> Cursor asks you to sign in when the server first connects.

> [tab] VS Code
>
> Add to `.vscode/mcp.json`:
>
> ```json theme={"dark"}
> {
>   "servers": {
>     "harwell": {
>       "type": "http",
>       "url": "https://harwell.metaphi.ai/mcp/"
>     }
>   }
> }
> ```
>
> VS Code asks you to sign in when the server first starts.

> [tab] Hum
>
> ```sh theme={"dark"}
> hum mcp add harwell https://harwell.metaphi.ai/mcp/
> hum mcp login harwell
> ```

The browser opens Metaphi AI's [sign-in](https://docs.metaphi.ai/account/sign-in.md). Once you are signed in, the client lists the tools your access reaches. If it lists none, [request access](https://docs.metaphi.ai/account/access.md).

## From a service or CI

Send an [organization key](https://docs.metaphi.ai/account/keys.md) as a bearer token at the same URL.

> [tab] Claude Code
>
> ```sh theme={"dark"}
> claude mcp add --transport http harwell https://harwell.metaphi.ai/mcp/ \
>   --header "Authorization: Bearer $METAPHI_API_KEY"
> ```

> [tab] Codex
>
> ```toml theme={"dark"}
> [mcp_servers.harwell]
> url = "https://harwell.metaphi.ai/mcp/"
> bearer_token_env_var = "METAPHI_API_KEY"
> ```

> [tab] Cursor
>
> ```json theme={"dark"}
> {
>   "mcpServers": {
>     "harwell": {
>       "url": "https://harwell.metaphi.ai/mcp/",
>       "headers": {
>         "Authorization": "Bearer mai_sk_..."
>       }
>     }
>   }
> }
> ```

> [tab] VS Code
>
> ```json theme={"dark"}
> {
>   "inputs": [
>     {"type": "promptString", "id": "metaphi-key", "description": "Metaphi API key", "password": true}
>   ],
>   "servers": {
>     "harwell": {
>       "type": "http",
>       "url": "https://harwell.metaphi.ai/mcp/",
>       "headers": {
>         "Authorization": "Bearer ${input:metaphi-key}"
>       }
>     }
>   }
> }
> ```

> [tab] Python
>
> ```python theme={"dark"}
> import asyncio, os
> from mcp import ClientSession
> from mcp.client.streamable_http import streamablehttp_client
>
> async def main():
>     headers = {"Authorization": f"Bearer {os.environ['METAPHI_API_KEY']}"}
>     async with streamablehttp_client("https://harwell.metaphi.ai/mcp/", headers=headers) as (read, write, _):
>         async with ClientSession(read, write) as session:
>             await session.initialize()
>             tools = await session.list_tools()
>             print([t.name for t in tools.tools])
>
> asyncio.run(main())
> ```

A failure to connect or sign in is on [Errors](https://docs.metaphi.ai/account/errors.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.