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

# MCP Server

WisdomAI provides a hosted [Model Context Protocol (MCP)](https://modelcontextprotocol.io) server that lets you connect AI tools, such as Claude, Cursor, VS Code, and ChatGPT, directly to your WisdomAI domains. Once connected, you can ask natural language questions about your data and receive structured responses including text, tables, and interactive charts.

## Endpoint

The WisdomAI MCP Server is available at a single endpoint:

```text theme={null}
https://{ACCOUNT}.wisdom.ai/mcp
```

Replace `{ACCOUNT}` with your WisdomAI account subdomain.

<Note>
  The MCP endpoint must match the domain you use to log in.

  * If you log in via `{account}.wisdom.ai`, use `https://{ACCOUNT}.wisdom.ai/mcp`
  * If you log in via `{account}.askwisdom.ai`, use `https://{ACCOUNT}.askwisdom.ai/mcp`
</Note>

## Connect your client

Add the WisdomAI MCP Server to your preferred AI client using the configuration below.

<Tabs>
  <Tab title="Claude Code">
    Run this command in your terminal:

    ```bash theme={null}
    claude mcp add --transport http wisdomai https://{ACCOUNT}.wisdom.ai/mcp
    ```

    Then authenticate by running `/mcp` in Claude Code and following the OAuth flow.
  </Tab>

  <Tab title="Cursor">
    Add the following to your `~/.cursor/mcp.json` file:

    ```json theme={null}
    {
      "mcpServers": {
        "wisdomai": {
          "url": "https://{ACCOUNT}.wisdom.ai/mcp"
        }
      }
    }
    ```
  </Tab>

  <Tab title="VS Code">
    Add the following to your VS Code MCP settings (`.vscode/mcp.json`):

    ```json theme={null}
    {
      "servers": {
        "wisdomai": {
          "type": "http",
          "url": "https://{ACCOUNT}.wisdom.ai/mcp"
        }
      }
    }
    ```
  </Tab>

  <Tab title="Other Clients">
    For any MCP-compatible client, use the following configuration:

    | Transport                         | URL                               |
    | :-------------------------------- | :-------------------------------- |
    | **Streamable HTTP** (recommended) | `https://{ACCOUNT}.wisdom.ai/mcp` |

    Most clients accept a JSON configuration in this format:

    ```json theme={null}
    {
      "mcpServers": {
        "wisdomai": {
          "url": "https://{ACCOUNT}.wisdom.ai/mcp"
        }
      }
    }
    ```

    If your client does not support remote HTTP connections directly, use the `mcp-remote` proxy:

    ```json theme={null}
    {
      "mcpServers": {
        "wisdomai": {
          "command": "npx",
          "args": ["-y", "mcp-remote", "https://{ACCOUNT}.wisdom.ai/mcp"]
        }
      }
    }
    ```
  </Tab>
</Tabs>

<Note>
  Replace `{ACCOUNT}` with your WisdomAI account url above.
</Note>

## Authentication

When you first connect, your client will prompt you to:

1. Log in with your WisdomAI account.
2. Accept the OAuth authorization.
3. Grant access to the necessary permissions.

The server implements **OAuth 2.1** with **Dynamic Client Registration (DCR)** and **Proof Key for Code Exchange (PKCE)**, following the [MCP Authorization specification](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization). This means:

* **No manual setup required**: clients register automatically.
* **Secure token binding**: tokens are scoped to your MCP session.
* **Session continuity**: each session maintains its own context and can handle multiple requests with the same token.

<Accordion title="OAuth Discovery Endpoints">
  The server exposes standard OAuth discovery endpoints for clients that need them:

  * **Protected Resource Metadata**: `/.well-known/oauth-protected-resource`
  * **Authorization Server Metadata**: `/.well-known/oauth-authorization-server`

  The authorization server metadata endpoint returns the locations of additional endpoints, including:

  * **DCR**: `/register` (obtained from `registration_endpoint`)
  * **Authorization Endpoint**: `/authorize` (obtained from `authorization_endpoint`)
  * **Token Endpoint**: `/token` (obtained from `token_endpoint`)

  MCP clients should query the `/.well-known/oauth-authorization-server` endpoint to discover the actual URLs rather than assuming fixed paths.
</Accordion>

## Available tools

Once connected, the following tools are available:

| Tool                                                            | Description                                                                                             |
| :-------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------ |
| [**chat**](/integrations/mcp-server/tools/chat)                 | Ask natural-language questions about your data domains. Returns text, tables, and chart visualizations. |
| [**list-domains**](/integrations/mcp-server/tools/list-domains) | Discover available domains and their IDs before making queries.                                         |
| [**echo**](/integrations/mcp-server/tools/echo)                 | Test connectivity and verify the request/response flow is working.                                      |

## Example prompts

Once connected, try these prompts to start using WisdomAI from your AI client:

* `What domains are available in WisdomAI?`
* `Show me total revenue by region as a table`
* `What are the top 5 products by sales this quarter?`
* `Visualize monthly active users over the last 12 months`
* `What can I ask about the Sales domain?`

## Test with MCP Inspector

You can test the WisdomAI MCP Server using the [MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector):

1. Install and launch the MCP Inspector:
   ```bash theme={null}
   npx @modelcontextprotocol/inspector
   ```
2. In the Inspector, enter your MCP server URL:
   ```text theme={null}
   https://{ACCOUNT}.wisdom.ai/mcp
   ```
3. Click **Connect**. The Inspector will automatically handle the OAuth authorization flow.
4. Once connected, click **List Tools** to see the available tools.
5. Select a tool (for example, **list-domains**) and click **Call** to test it.

The Inspector provides an interactive interface to test tool calls, inspect responses, and debug authentication.

## Troubleshooting

| Issue                      | Resolution                                                                                                                        |
| :------------------------- | :-------------------------------------------------------------------------------------------------------------------------------- |
| OAuth authentication fails | Ensure your client supports OAuth. Try reauthenticating using your client's MCP management flow.                                  |
| Tools not appearing        | Verify that authentication completed successfully and that you have access to at least one WisdomAI domain.                       |
| Connection timeout         | Check that the server URL is correct (`https://{ACCOUNT}.wisdom.ai/mcp`) and that your network allows outbound HTTPS connections. |
| Empty responses from chat  | Make sure you are providing a valid `domainId`. Use the **list-domains** tool first to find available domain IDs.                 |

<Info>
  For any queries or support, contact our team at [**support@wisdom.ai**](mailto:support@wisdom.ai).
</Info>
