npm Package Setup
The@smartalex/mcp-server npm package lets you run SmartAlex’s MCP server locally on your machine. It communicates with your AI client over stdio and authenticates to SmartAlex’s API using your API key.
Prefer zero setup? Use the cloud connection instead, no installation, automatic updates, and OAuth authentication.
Install
No global install needed. Your AI client runs the package vianpx:
- Node.js 18 or later
- A SmartAlex API key (generate one in the Developer Portal)
Get Your API Key
- Log in to your SmartAlex Dashboard
- Open the Developer Portal from the side navigation
- Generate a new API key
- Choose your environment:
sa_live_, production datasa_test_, staging/test data
- Copy the key immediately, it won’t be shown again
Client Setup
Claude Desktop
Add SmartAlex to your Claude Desktop configuration file.- macOS
- Windows
- Linux
Edit
~/Library/Application Support/Claude/claude_desktop_config.json:Claude Code
smartalex listed with 28 tools.
Cursor
Add to.cursor/mcp.json in your project root (project-level) or ~/.cursor/mcp.json (global):
- macOS / Linux
- Windows
Developer: Reload Window.
VS Code (GitHub Copilot)
Add to.vscode/mcp.json in your project:
- macOS / Linux
- Windows
Windsurf
Add to your Windsurf MCP configuration:Gemini CLI
Add to your Gemini CLI settings file at~/.gemini/settings.json:
/mcp to connect.
Configuration
Environment Variables
The API key is the only configuration needed. The server automatically connects to SmartAlex’s production API gateway.
Version Pinning
To lock to a specific version (recommended for production automations):Updating
To update to the latest version:@smartalex/mcp-server (without npx) as the command in your config:
What’s Included
The npm package provides the same 28 tools, 7 resources, and 5 prompts as the cloud endpoint:
See the Tools Reference for the complete list with parameters and examples.
Architecture
- Your AI client spawns the MCP server as a local process
- Communication happens over stdio (stdin/stdout)
- The server authenticates to SmartAlex’s API using your API key
- All data stays within your SmartAlex workspace, workspace isolation is enforced server-side
Troubleshooting
”Authentication failed” or 401 errors
- Verify your key starts with
sa_live_orsa_test_ - Check the key hasn’t expired or been revoked in the dashboard
- 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
/mcpto check server status
First run is slow
The firstnpx @smartalex/mcp-server downloads the package (~20 kB + dependencies). Subsequent runs use the npx cache and start in under 2 seconds.
Windows: “npx is not recognized”
Ensure Node.js is installed and in your PATH:Windows: spawn errors
Windows requires thecmd /c wrapper. See the Windows tab in the setup section above.
npm Package vs Cloud
When to use local: Your organization requires local tool execution, you want to pin a specific version, or your AI client only supports stdio transport.
When to use cloud: You want zero setup, automatic updates, or OAuth-based authentication. Set up cloud connection →
Next Steps
- Usage Examples, Real-world workflows and conversation examples
- Tools Reference, Complete reference for all 28 tools
- Error Reference, Error codes and troubleshooting

