# Connect Semactic to an agent or another MCP client

Semactic has two MCP servers: one for the **documentation**, open to everyone without an account, and one for your **Semactic data**, reserved for customers (MCP add-on and API key).

This page gives their settings in a form an AI agent or a command-line MCP client can apply directly. For the Claude or ChatGPT interface, follow [Connect Semactic to Claude](https://docs.semactic.com/mcp/connect-claude) or [Connect Semactic to ChatGPT](https://docs.semactic.com/mcp/connect-chatgpt) instead.

## Documentation: public server, no account

The documentation MCP server is read-only and needs neither an account nor a key: `https://docs.semactic.com/mcp/public`.

```bash
claude mcp add --transport http semactic-docs-public https://docs.semactic.com/mcp/public
```

## Semactic data: server settings

| Setting | Value |
|---|---|
| Server URL | `https://mcp.semactic.com/mcp` |
| Transport | HTTP (Streamable HTTP) |
| Authentication | OAuth, authorization code with PKCE (`S256`) |
| Client registration | Dynamic: leave the OAuth client ID and client secret empty |
| Credential requested | Your Semactic API key, entered on the authorization page |

> [!NOTE]
> The MCP server requires the **MCP** add-on. Your API key is on the **Semactic API** card of the **Integration** page: see [Semactic API and MCP server](https://docs.semactic.com/integrations/semactic-api).

## What the agent does, what you do

- **The agent** adds the server to its MCP client configuration and starts the authorization.
- **You** paste your API key on the authorization page that opens in your browser, then click **Authorize**.

> [!WARNING]
> Do not paste your API key into a conversation or write it in a configuration file: enter it only on the Semactic authorization page. Anyone who has this key can read your data.

## Claude Code

Add the server:

```bash
claude mcp add --transport http semactic https://mcp.semactic.com/mcp
```

In Claude Code, type `/mcp`, choose **semactic** and start the authentication. Your browser opens: paste your API key and click **Authorize**.

## JSON configuration file

For a client that reads a configuration file (for example `.mcp.json` for Claude Code):

```json
{
  "mcpServers": {
    "semactic": {
      "type": "http",
      "url": "https://mcp.semactic.com/mcp"
    }
  }
}
```

The exact field names depend on the client: some expect `streamable-http` as the type, others only the URL. Use the URL and transport from the table above in your client's format.

## Check the connection

Ask the agent to call `get_my_account_context`, then `list_projects`: it should return your account and your projects. The full list of tools is described in [Semactic MCP tools: overview](https://docs.semactic.com/mcp-tools/overview).

## If the connection fails

- **The server answers 401**: the authorization was not completed or has expired. Start the authentication again from your client.
- **The key is refused**: check that the **MCP** add-on is active and that the key is the right one. After **Refresh key**, the previous key stops working immediately.
