Environment & Flags

Configure the MCP server with environment variables and CLI flags.

The IndexMind MCP server can be configured through environment variables, CLI flags, or a combination of both. CLI flags always take precedence over environment variables when both are set.

Environment variables

Set these in your shell profile, .env file, or directly in your IDE's MCP server configuration under the env key.

VariableRequiredDefaultDescription
INDEXMIND_API_KEYYesNoneOrg-scoped API key created in Project Settings > MCP. Starts with imcp_.
INDEXMIND_API_URLNohttp://localhost:8080The IndexMind API endpoint. Set to https://api.indexmind.ai for production.
INDEXMIND_PROJECT_IDNoNoneDefault project ID. If set, tools that require a project context will use this value unless overridden per-request.

The INDEXMIND_API_KEY is the only required configuration. Without it, the server will refuse to start.

CLI flags

Pass these as arguments when starting the server, either directly on the command line or in your IDE's MCP args array.

FlagDescription
--api-urlOverride the API endpoint. Takes precedence over INDEXMIND_API_URL.
--project-idSet the default project context. Takes precedence over INDEXMIND_PROJECT_ID.
--readonlyDisable all write tools (update_recommendation_status, generate_narrative_actions, update_narrative_action, approve_agent_action). Only read-only tools will be exposed to the IDE.
--log-levelSet log verbosity. Accepted values: error, info, debug. Defaults to error.

Precedence order

When the same setting is provided in multiple places, the server resolves the value in this order (highest priority first):

  1. CLI flags: e.g., --api-url https://api.indexmind.ai
  2. Environment variables: e.g., INDEXMIND_API_URL=https://api.indexmind.ai
  3. Built-in defaults: e.g., http://localhost:8080

Example: full command

The following command starts the MCP server pointed at the production API, locked to a specific project, with write tools disabled and verbose logging:

INDEXMIND_API_KEY=imcp_YOUR_KEY \
  node dist/index.js \
  --api-url https://api.indexmind.ai \
  --project-id proj_123 \
  --readonly \
  --log-level debug

Example: IDE configuration with env and flags combined

In your IDE's MCP configuration, you can mix env and args to keep secrets out of the args list:

{
  "mcpServers": {
    "indexmind": {
      "command": "node",
      "args": [
        "/path/to/packages/mcp-server/dist/index.js",
        "--api-url", "https://api.indexmind.ai",
        "--project-id", "proj_123",
        "--readonly"
      ],
      "env": {
        "INDEXMIND_API_KEY": "imcp_YOUR_KEY"
      }
    }
  }
}

Keep the API key in the env block rather than the args array. Some IDEs may log or display command-line arguments in the UI, but environment variables are typically hidden.