What is this page about: Light's MCP integration connects AI clients (Claude Code, OpenCode, Claude Desktop, n8n) to a Light account. Once connected, the AI client can query Light financial data (invoices, vendors, reports) and take permitted actions (approving tasks, creating contracts) using natural language, within the connecting user's own role and permissions. This page defines what Light's MCP integration is, lists prerequisites, and gives step-by-step instructions to generate a token, configure each supported AI client, verify the connection, manage tokens, and resolve common errors.
On this page
- What is Light's MCP integration
- Prerequisites
- Step 1: Generate a token
- Step 2: Configure your AI client
- Step 3: Verify the connection
- Manage your tokens
- Troubleshooting
- Frequently asked questions
- Related Articles
What is Light's MCP integration
Light's MCP integration is a feature that lets an AI client read Light financial data and perform permitted actions in Light, using natural-language requests instead of navigating the Light interface manually.
With Light's MCP integration, an AI client can:
- Query financial data, for example account balances and transaction history
- Search invoices
- Look up vendors
- Run reports
- Take actions, drawn from over 100 available tools, for example marking an invoice as paid, approving a task, or creating a contract
Where the AI model runs: The AI model itself runs on the user's own machine, rather than on Light's servers. Light's MCP integration receives the individual tool calls the user's AI client sends, and returns the result of each one. Your conversation history and the model's output stay on your machine.
Permission scope: A Light MCP token inherits the role and permissions of the Light user who created it. An AI client connected with that token can perform only the actions that user is already permitted to perform in Light. Light's MCP integration cannot grant an AI client any permission the connecting user does not already have.
Prerequisites
Before connecting an AI client to Light, confirm the following:
- The AI client is installed. Install the specific AI client (Claude Code, OpenCode, Claude Desktop, or n8n) on the machine that will connect to Light, before starting Step 1.
Step 1: Generate a token
A Light MCP token is a credential that authorises an AI client to call Light's MCP integration on behalf of a specific Light user.
Token ownership rule: Each Light user generates and manages their own tokens. A Light MCP token is personal to the user who created it and is not shared across users.
Token visibility rule: Light displays the full raw token value only once, at creation time. Light does not display the full raw token value again after the creation dialog is closed. Copy the token before closing the dialog.
Steps to generate a token in Light:
- Open Settings → Profile in Light.
- Scroll to the MCP tokens section.
- Click Add.
- In the Create MCP token dialog, enter a descriptive name for the token (example:
Claude Code - MacBook). Optionally turn on the Set expiration date toggle to set an expiry. - Click Create.
- Copy the token shown in the confirmation dialog. The token value starts with the prefix
lmcp_. - Turn on the I have saved my token toggle, then click Done.
Token limit: Each Light user can have a maximum of 20 active tokens at one time. If a user reaches this limit, that user must revoke an existing active token before Light will allow creation of a new one.
Step 2: Configure your AI client
This step differs depending on which AI client is being connected. Locate the subsection for the specific AI client below.
Claude Code
To connect Claude Code to Light, run the following command once, replacing the placeholder with the token generated in Step 1:
claude mcp add --transport http light-mcp https://api.light.inc/rest/ext/mcp --header "Authorization: Bearer lmcp_your_token_here"
After running this command, restart Claude Code. Light's tools will then appear in Claude Code's tool list.
OpenCode
Connecting OpenCode to Light requires two steps: setting an environment variable, then editing a configuration file.
Step 2a: Set the environment variable. Add the following line to the shell profile file (~/.zshrc, ~/.bashrc, or equivalent), then reload the shell:
export LIGHT_MCP_TOKEN="lmcp_paste_your_token_here"
source ~/.zshrc # or ~/.bashrc
Step 2b: Edit the OpenCode configuration file. Open ~/.config/opencode/opencode.json and add a light entry under the mcp key:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"light": {
"type": "remote",
"url": "https://api.light.inc/rest/ext/mcp",
"headers": {
"Authorization": "Bearer {env:LIGHT_MCP_TOKEN}"
}
}
}
}
OpenCode-specific error: If OpenCode displays ⚠ needs authentication, the LIGHT_MCP_TOKEN environment variable was not set in the shell session OpenCode launched from. Fix: open a new terminal window (where the environment variable has been exported), then relaunch OpenCode.
Claude Desktop
Connecting Claude Desktop to Light uses a guided walkthrough rather than manual configuration. Follow this walkthrough: Connect Light's MCP server from Claude Desktop
n8n
Connecting n8n to Light uses a guided walkthrough rather than manual configuration. Follow this walkthrough: Connect Light's MCP server from n8n
Step 3: Verify the connection
To confirm the AI client is connected to Light, open the AI client and send this exact prompt:
"What Light tools do you have available?"
Expected result if the connection succeeded: The AI client lists the names of Light's tools that it can call. This confirms Light's MCP integration is connected and working.
Expected result if the connection failed: The AI client does not mention any Light tools, or returns an authentication/connection error. If this happens, see the Troubleshooting section below.
Manage your tokens
All Light MCP token management happens in one place: Settings → Profile → MCP tokens.
Viewing tokens: The MCP tokens list in Light shows each token's name, a status badge (Active or Revoked), and a Created date. Click a token to open its detail view, which shows its full status, its obfuscated token value, when it was created, its expiry date, and when it was last used.
Revoking a token: To revoke a Light MCP token, click the token to open its details, then click Revoke token. Token revocation in Light is immediate. After a token is revoked, the next request that uses that token returns a 401 error. Token revocation cannot be undone. If access is still needed after revoking a token, generate a new token (repeat Step 1).
Troubleshooting
Each row below states one symptom, its most likely cause in Light, and the recommended fix.
| Symptom | Likely cause | Fix |
|---|---|---|
401 Unauthorized |
The token is revoked, expired, or was not set correctly | Check Settings → MCP tokens in Light for the token's status; create a new token if needed |
| Tools list is empty or shorter than expected | The connected Light user's role does not have access to those tools | Light tools respect the connecting user's existing Light permissions; check the user's role in Settings → Users |
OpenCode shows ⚠ needs authentication |
The LIGHT_MCP_TOKEN environment variable was not set in the session OpenCode launched from |
Open a new terminal (with the variable exported) and relaunch OpenCode |
{"error":{"code":-32601}} |
The AI client sent a method Light's MCP server doesn't recognize, often because the client is outdated | Update the AI client to its latest version |
| Any other error | Network issue or a temporary Light server issue | Check the network connection and retry; if the issue persists, contact Light support with the exact error details |
Frequently asked questions
Does Light's MCP integration send my AI conversation history to Light?
Light receives the individual tool calls your AI client sends, and nothing beyond them. Your conversation history stays on your own machine.
Can my AI assistant do things in Light that I'm not allowed to do myself?
A Light MCP token inherits your own role and permissions, so the AI client can do exactly what you can do in Light, and no more.
Where do I generate a Light MCP token?
In Light, go to Settings → Profile → MCP tokens, then click Add.
How many active Light MCP tokens can one user have?
Up to 20 active tokens per Light user at one time.
What happens immediately after I revoke a Light MCP token?
The token stops working immediately. The next request that uses that token returns a 401 Unauthorized error.
Which AI clients can connect to Light today?
Claude Code, OpenCode, Claude Desktop, and n8n.
How do I confirm my AI client is actually connected to Light?
Ask the AI client: "What Light tools do you have available?" If connected, it will list Light's tool names.
I still need help. What should I do?
Contact Light support with the exact error message and the AI client you're using.