# Local MCP server > Run the flax-mcp stdio server locally — configure it with FLAX_BASE_URL and FLAX_API_TOKEN and register it with Claude Code or a .mcp.json *[View this page in the Flax docs](https://flax-analytics.com/docs/developers/mcp-local)* `flax-mcp` is a local Model Context Protocol server that speaks stdio and calls the Flax [REST API](/docs/api-reference/overview) as a bearer-token client. Your token stays on your machine. This page is for developers wiring Flax into a local MCP client such as Claude Code. ## Prerequisites 1. Create a **service account** and issue a token on the [API access page](/app/settings/api). Choose `read` to explore and add `write` to create or update artifacts. 2. Assign the service account to [teams](/docs/administration/teams-and-rbac) so it can see the data you want. ## Configuration The server reads two environment variables: | Variable | Value | | --- | --- | | `FLAX_BASE_URL` | Your Flax origin, e.g. `https://flax.example.com` | | `FLAX_API_TOKEN` | The service-account token secret (`flax_pat_…`) | ## Register with Claude Code ```bash claude mcp add flax -- env FLAX_BASE_URL=https://flax.example.com \ FLAX_API_TOKEN=flax_pat_xxx /path/to/flax-mcp ``` ## Register with a `.mcp.json` Any MCP client that reads a `.mcp.json` (or equivalent config) can launch the binary directly: ```json { "mcpServers": { "flax": { "command": "/path/to/flax-mcp", "env": { "FLAX_BASE_URL": "https://flax.example.com", "FLAX_API_TOKEN": "flax_pat_xxx" } } } } ``` Once connected, the client can call every tool in the [MCP tools reference](/docs/developers/mcp-tools). Access is bounded by the token's scopes and the service account's team/row-level-security — the server adds no privilege. ## Related - [MCP overview](/docs/developers/mcp-overview) - [MCP tools](/docs/developers/mcp-tools) - [Authentication](/docs/developers/authentication)