MCP Server
Connect AI assistants to Lightfast through hosted OAuth MCP or the local stdio server.
MCP Server
Lightfast supports two MCP connection modes:
- Hosted OAuth MCP for user-connected clients. This is recommended when your client supports remote MCP and OAuth.
@lightfastai/mcpstdio for local, CI, and API-key based clients.
Both modes expose the same policy-derived Lightfast tools.
Hosted OAuth MCP
Use the hosted MCP resource when a client can connect to a remote MCP server:
In local development, the resource URL is:
[<wt>.] is an optional local worktree prefix. Use
https://mcp.lightfast.localhost/mcp in the primary worktree, or a prefixed
URL such as https://remote-mcp.mcp.lightfast.localhost/mcp in a secondary
worktree.
The OAuth flow creates a user-connected grant bound to the selected organization. You can review or revoke grants from MCP settings.
Local stdio MCP
Use the stdio package when your MCP client expects a local command or when you need API-key automation. Run directly with npx:
Or install globally:
Configuration
Choose your AI assistant and add the configuration:
Claude Desktop
Add to your claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Restart Claude Desktop after saving.
Claude Code (CLI)
Add to .mcp.json in your project root:
Or use the CLI:
For global (user-level) configuration, add to ~/.claude.json or use --scope user.
Cursor
Add to .cursor/mcp.json in your project root:
OpenAI Codex
Add to ~/.codex/config.toml:
Available Tools
Once configured, your AI assistant has access to the Lightfast MCP tools selected by the public API contract policy.
lightfast_system_health
Check whether the Lightfast MCP connection is authenticated and reachable.
Required scope: mcp:system:read
Parameters: none.
Response includes status, timestamp, and version.
lightfast_signals_create
Create a signal in the connected organization.
Required scope: mcp:signals:write
Requires the grant to be bound to the selected organization.
| Parameter | Type | Required | Description |
|---|---|---|---|
input | string | Yes | Signal text. Trimmed, 1-4000 characters. |
Response includes the new signal_<uuid> id, status: "queued", and
visibilityScope: "user".
lightfast_signals_get
Get a visible signal by id from the connected organization.
Required scope: mcp:signals:read
Requires the grant to be bound to the selected organization.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Signal id in signal_<uuid> format. |
Response includes id, input, status, classification,
visibilityScope, createdAt, and updatedAt. classification is null
until available.
Usage Examples
Once configured, you can ask your AI assistant questions like:
- "Create a Lightfast signal for this follow-up"
- "Check the status of this signal"
- "Confirm my Lightfast MCP connection is healthy"
The AI assistant will automatically call the relevant Lightfast MCP tool when needed.
CLI Options
Environment Variables
Instead of passing --api-key, you can set the environment variable:
This is especially useful in MCP configurations where you don't want to hardcode the key:
Troubleshooting
Server not connecting
- Verify your API key is valid and starts with
lf_ - Check that Node.js >= 18 is installed
- Restart your AI assistant after configuration changes
Tools not appearing
- Ensure the MCP server is running (check logs)
- Verify the configuration file is in the correct location
- For Claude Code, run
/mcpto check server status
Permission errors
- Check that your API key has access to the workspace
- Confirm the organization has searchable memory available
- Regenerate the API key if it was revoked or rotated