Skip to main content
The @smartalex/mcp-server npm package runs a SmartAlex MCP server on your own machine. It talks to your AI app over stdio and signs in to SmartAlex with your API key. It suits a setup that already has a key or needs a local server.
In SmartAlex, owners and admins create the key under Settings → Webhooks & API. Create key or Open in the API keys panel opens the API keys tab.
This is the older local package. It needs an API key, which owners and admins can create as a read-only key in Settings → Webhooks & API. Most people should connect to https://mcp.getsmartalex.com by signing in instead. See Getting started.

How do I install it?

No global install needed. Your AI client runs the package via npx:
Requirements:
  • Node.js 18 or later
  • A SmartAlex API key (owners and admins create a read-only key in Settings → Webhooks & API)
Package details:

What API key does it need?

The package reads its key from the SMARTALEX_API_KEY environment variable. Keys start with:
  • sa_live_, production data
  • sa_test_, staging/test data
Owners and admins create a key in Settings → Webhooks & API. A key they make reads your workspace but cannot change your records. Most people should connect to the hosted server by signing in instead.
Keep your API key secret. Never commit it to version control or share it publicly. Use environment variables instead.

How do I set it up in my AI app?

Claude Desktop

Add SmartAlex to your Claude Desktop configuration file.
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
After saving: Fully quit Claude Desktop and reopen it. The SmartAlex tools will appear in the tool menu (hammer icon).

Claude Code

Set your API key as an environment variable:
Verify the connection:
You should see smartalex listed with its 28 tools.

Cursor

Add to .cursor/mcp.json in your project root (project-level) or ~/.cursor/mcp.json (global):
After saving: Restart Cursor or use the command palette: Developer: Reload Window.

VS Code (GitHub Copilot)

Add to .vscode/mcp.json in your project.

Windsurf

Add to your Windsurf MCP configuration.

Gemini CLI

Add to ~/.gemini/settings.json, your Gemini CLI settings file.
Then restart Gemini CLI or run /mcp to connect.

How do I configure it?

Which environment variables does it use?

The API key is the only configuration needed. The server automatically connects to SmartAlex’s production API gateway.

How do I pin a version?

To pin a version, which is recommended for production automations.

How do I update it?

To update, run this.
For faster startup, install globally.
Then use @smartalex/mcp-server (without npx) as the command in your config:

What does the package include?

The npm package has its own 28 tools, 7 resources, and 5 prompts. These are not the same tools as the hosted connection, which has more than 100. The Tools reference documents the hosted connection. Some tools listed there are not in this package.

How does it work?

  1. Your AI client spawns the MCP server as a local process
  2. Communication happens over stdio (stdin/stdout)
  3. The server authenticates to SmartAlex’s API using your API key
  4. All data stays within your SmartAlex workspace, workspace isolation is enforced server-side

What if it does not work?

”Authentication failed” or 401 errors

  • Verify your key starts with sa_live_ or sa_test_
  • Check the key hasn’t expired or been revoked
  • Confirm the environment variable is set:

Tools not appearing

  • Restart your AI client completely after config changes
  • Claude Desktop: Fully quit (not just close window) and reopen
  • Cursor: Command palette > Developer: Reload Window
  • Claude Code: Run /mcp to check server status

First run is slow

The first npx @smartalex/mcp-server downloads the package and its dependencies. Later runs use the npx cache and start much faster.

Windows: “npx is not recognized”

Ensure Node.js is installed and in your PATH:
If not installed, download from nodejs.org.

Windows: spawn errors

Windows requires the cmd /c wrapper. See the Windows tab in the setup section above.

How is it different from the hosted connection?

When to use local: You already have an API key. Or your organization requires local tool execution, you want to pin a specific version, or your AI client only supports stdio transport. When to use the hosted connection: In almost every case. No setup, automatic updates, every tool, and you sign in instead of using an API key. Set up the hosted connection.

Questions people ask

Almost everyone should use the hosted connection, where you sign in instead of using an API key and get every tool the server offers. Use the npm package only if you already have an API key, need a local stdio server, or want to pin a version.
It has its own 28 tools, 7 resources and 5 prompts. These are not the same as the hosted connection, which has more than 100 tools. Some tools in the Tools reference are not in this package.
A SmartAlex API key in the SMARTALEX_API_KEY environment variable. Owners and admins create a read-only key in Settings under Webhooks & API. Never commit the key or share it.
Windows needs the cmd /c wrapper as the command, with the -y flag so npx accepts its install prompt. Also check that Node.js 18 or later is installed and on your PATH.
Add the version to the package name in your config, for example @smartalex/mcp-server@0.5.0, to pin it. To update, run npx with @latest, or install the package globally with npm.

Get started

Connect with a sign-in instead of a key.

Tools reference

Reference for the hosted connection’s tools.

Usage examples

Real workflows and conversation examples.

Error reference

Error codes and troubleshooting.
Last modified on November 27, 2026