Skip to content

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.

  • Node.js 20 or newer, with npx on the PATH of 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_…).
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.

The simplest setup. npx downloads the package on first use and caches it:

Terminal window
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.

A global install puts the smsfabric-mcp command on your PATH, so the client starts it without npx:

Terminal window
npm install -g @smsfabric/mcp-server

Then 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.

To try an unreleased change, build the server from the monorepo:

  1. Clone the repository and install its dependencies.

    Terminal window
    git clone https://github.com/elshahat/smsfabric.git
    cd smsfabric
    pnpm install
  2. Build the SDK and the server.

    Terminal window
    pnpm --filter @smsfabric/sdk build
    pnpm --filter @smsfabric/mcp-server build
  3. Point your client at the built file with an absolute path: command node, argument /path/to/smsfabric/packages/mcp-server/dist/cli.js.

The MCP Inspector starts the server and lets you call each tool by hand, without an assistant:

Terminal window
npx @modelcontextprotocol/inspector -e SMSFABRIC_API_KEY=sf_test_xxxxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx npx -y @smsfabric/mcp-server

Open 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.