Install the MCP server
You don’t start the server yourself in normal use: your MCP client starts it when it needs it. This page covers what the client runs and the variables it needs. To add it to a client, go to Clients.
Requirements
Section titled “Requirements”- Node.js 20 or newer, with
npxon thePATHof the app that starts the server. - An SMSFabric API key. Create one under Developers → API keys in the portal (walkthrough) with only the scopes you need (which ones). Start with a test key (
sf_test_…).
Environment variables
Section titled “Environment variables”| Variable | Required | Value |
|---|---|---|
SMSFABRIC_API_KEY |
yes | sf_live_… or sf_test_…. The server exits at start without it. |
SMSFABRIC_BASE_URL |
no | The API origin. Defaults to https://api.smsfabric.com; an empty value counts as unset. Set http://localhost:3000 for a local API. |
Your client passes these to the server in its configuration, usually an env block.
Run with npx
Section titled “Run with npx”The simplest setup. npx downloads the package on first use and caches it:
SMSFABRIC_API_KEY=sf_test_xxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx npx -y @smsfabric/mcp-server-y skips the install prompt, which a client cannot answer. When the server is running it prints smsfabric-mcp: connected (https://api.smsfabric.com) to stderr and waits for a client on stdin. Stop it with Ctrl+C.
Install globally
Section titled “Install globally”A global install puts the smsfabric-mcp command on your PATH, so the client starts it without npx:
npm install -g @smsfabric/mcp-serverpnpm add -g @smsfabric/mcp-serveryarn global add @smsfabric/mcp-serverThen use smsfabric-mcp as the command, with no arguments, in your client’s configuration. Update it with the same command when a new version comes out.
Run from source
Section titled “Run from source”To try an unreleased change, build the server from the monorepo:
-
Clone the repository and install its dependencies.
Terminal window git clone https://github.com/elshahat/smsfabric.gitcd smsfabricpnpm install -
Build the SDK and the server.
Terminal window pnpm --filter @smsfabric/sdk buildpnpm --filter @smsfabric/mcp-server build -
Point your client at the built file with an absolute path: command
node, argument/path/to/smsfabric/packages/mcp-server/dist/cli.js.
Check that it works
Section titled “Check that it works”The MCP Inspector starts the server and lets you call each tool by hand, without an assistant:
npx @modelcontextprotocol/inspector -e SMSFABRIC_API_KEY=sf_test_xxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx npx -y @smsfabric/mcp-serverOpen the address it prints, click Connect, then List Tools. Run list_devices: it only reads, so it is a safe first call. If something fails, see Troubleshooting.