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.
| Variable | Required | Default | Description |
|---|---|---|---|
INDEXMIND_API_KEY | Yes | None | Org-scoped API key created in Project Settings > MCP. Starts with imcp_. |
INDEXMIND_API_URL | No | http://localhost:8080 | The IndexMind API endpoint. Set to https://api.indexmind.ai for production. |
INDEXMIND_PROJECT_ID | No | None | Default 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.
| Flag | Description |
|---|---|
--api-url | Override the API endpoint. Takes precedence over INDEXMIND_API_URL. |
--project-id | Set the default project context. Takes precedence over INDEXMIND_PROJECT_ID. |
--readonly | Disable 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-level | Set 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):
- CLI flags: e.g.,
--api-url https://api.indexmind.ai - Environment variables: e.g.,
INDEXMIND_API_URL=https://api.indexmind.ai - 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.