> ## Documentation Index
> Fetch the complete documentation index at: https://support.i.moneyforward.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connection Guide

> How to connect AI coding assistants to Admina Remote MCP Server.

## Prerequisites

* Your AI coding assistant is installed
* You have an Admina API key ([How to get an API key](/en/api-reference/it-management/authentication))
* You have your organization ID

## Set Environment Variables

Add the following to your shell configuration file (`.bashrc`, `.zshrc`, etc.).
You can also set these values directly in your MCP configuration file. Adjust the format to match your tool.

```bash theme={null}
export ADMINA_API_KEY="<API_TOKEN>"
export ADMINA_ORG_ID="<Organization Id>"
```

Apply the configuration.

```bash theme={null}
source ~/.zshrc
```

<Info>
  If you use Codex CLI, the process reads environment variables at startup. After updating `.zshrc`, open a new terminal or run `source ~/.zshrc` before starting Codex. Changes do not apply to an already running process.
</Info>

## Configure MCP Server

Add the configuration for your tool.

<Tabs>
  <Tab title="Claude Code">
    Add the following to your project's `.mcp.json` or user settings (`~/.claude.json`).

    Claude Code's `headers` field does not expand environment variables. Use `headersHelper` to run a script for headers that need a dynamic value, such as `Authorization`. Static values, such as the organization ID, can go directly in `headers`.

    ```json theme={null}
    {
      "mcpServers": {
        "admina-itam": {
          "type": "http",
          "url": "https://mcp.itmc.i.moneyforward.com/mcp",
          "headers": {
            "X-Admina-Organization-Id": "<Organization ID>"
          },
          "headersHelper": "~/.claude/scripts/admina-itam-headers.sh"
        }
      }
    }
    ```

    The script in `headersHelper` must print a JSON object of headers to stdout.

    ```zsh theme={null}
    #!/usr/bin/env zsh
    [ -f "$HOME/.zshrc" ] && source "$HOME/.zshrc" >/dev/null 2>&1

    if [ -z "$ADMINA_API_KEY" ]; then
      echo "ADMINA_API_KEY is not set" >&2
      exit 1
    fi

    printf '{"Authorization": "Bearer %s"}' "$ADMINA_API_KEY"
    ```

    Make the script executable.

    ```bash theme={null}
    chmod +x ~/.claude/scripts/admina-itam-headers.sh
    ```

    <Info>
      For project-specific settings, place `.mcp.json` in your project root. For all projects, add it to `~/.claude.json`.
    </Info>
  </Tab>

  <Tab title="Claude Cowork">
    <Info>
      Claude Cowork cannot connect to this server because it cannot send custom headers. Use Claude Code instead. Support for Claude Cowork is under consideration for a future release.
    </Info>
  </Tab>

  <Tab title="Cursor">
    Create `.cursor/mcp.json` in your project root and add the following.

    Cursor's `headers` field expands environment variables using the `${env:NAME}` syntax.

    ```json theme={null}
    {
      "mcpServers": {
        "admina-itam": {
          "url": "https://mcp.itmc.i.moneyforward.com/mcp",
          "headers": {
            "Authorization": "Bearer ${env:ADMINA_API_KEY}",
            "X-Admina-Organization-Id": "${env:ADMINA_ORG_ID}"
          }
        }
      }
    }
    ```

    <Info>
      Cursor automatically reads `.cursor/mcp.json` from your project root. For global settings, place it in `~/.cursor/mcp.json`.
    </Info>

    You can also configure this from your team's admin dashboard. Enter `Authorization` and `X-Admina-Organization-Id` directly in the **HTTP headers** field.

    <Frame>
      <img src="https://mintcdn.com/moneyforwardi/U0nP8ZZ4d6AhkEbv/images/remote-mcp/it-management/connection-guide/cursor-team-mcp-settings.png?fit=max&auto=format&n=U0nP8ZZ4d6AhkEbv&q=85&s=997100b318e871dd7b792ca1c879aeb5" alt="Cursor team admin dashboard showing the Authorization and X-Admina-Organization-Id HTTP headers configured for the Admina-itam MCP server" style={{ maxWidth: "min(100%, 600px)", height: "auto" }} width="902" height="1065" data-path="images/remote-mcp/it-management/connection-guide/cursor-team-mcp-settings.png" />
    </Frame>
  </Tab>

  <Tab title="Codex">
    Codex reads environment variables from its own process at startup. After updating `.zshrc` or similar, open a new terminal or run `source ~/.zshrc` before starting Codex. Changes do not apply to an already running process.

    Register the MCP server with the CLI command.

    ```bash theme={null}
    codex mcp add admina-itam --url "https://mcp.itmc.i.moneyforward.com/mcp" --bearer-token-env-var ADMINA_API_KEY
    ```

    This command only sets the `Authorization` header. There is no CLI flag to add the `X-Admina-Organization-Id` header, so add it manually to `~/.codex/config.toml`.

    ```toml theme={null}
    [mcp_servers.admina-itam.http_headers]
    X-Admina-Organization-Id = "<Organization ID>"
    ```

    After running the command above, `~/.codex/config.toml` looks like this.

    ```toml theme={null}
    [mcp_servers.admina-itam]
    url = "https://mcp.itmc.i.moneyforward.com/mcp"
    bearer_token_env_var = "ADMINA_API_KEY"

    [mcp_servers.admina-itam.http_headers]
    X-Admina-Organization-Id = "<Organization ID>"
    ```

    <Info>
      You can also configure this from the Codex App UI.
    </Info>

    By default, each MCP tool call requires approval. In a non-interactive mode such as `codex exec`, calls are automatically canceled while waiting for approval. To always allow a specific tool, select **always allow** in the App UI, or add the following to `~/.codex/config.toml`.

    ```toml theme={null}
    [mcp_servers.admina-itam.tools.<tool_name>]
    approval_mode = "approve"
    ```
  </Tab>
</Tabs>

## Verify the Connection

Start your tool and verify that Admina tools are available.

```text theme={null}
組織情報を取得してください
```

If organization name and status are returned, the connection is working.

<Info>
  With Codex CLI, you can also run `codex doctor` to check your configuration. If the output shows `mcp.config: ok`, the MCP server configuration was loaded correctly.
</Info>

## Available Tools

36 tools are available after connection. See the [Tool Reference](/en/remote-mcp/it-management/tools) for details.
