---
title: "Use the MCP server with Claude Code"
description: "Add the OmniChannels.ai MCP server to Claude Code with claude mcp add, share it in .mcp.json, keep the token in an environment variable and gate send tools."
canonical: "https://omnichannels.ai/developers/mcp-claude-code/"
language: "en"
updated: "2026-10-10"
publisher: "BroadNet Technologies"
brand: "OmniChannels.ai"
section: "Tools"
---

# Use the MCP server with Claude Code

Canonical: https://omnichannels.ai/developers/mcp-claude-code/
Language: en
Publisher: OmniChannels.ai by BroadNet Technologies

Claude Code, Anthropic's command-line coding agent, can connect to the [MCP server](/developers/mcp/) so that it sends test messages, lists WhatsApp templates and reads delivery reports on your account while it helps you build an integration. This page shows the setup. Claude Code's own MCP documentation is the reference for its commands and file formats: [Connect Claude Code to tools via MCP](https://code.claude.com/docs/en/mcp).

| Setting | Value |
| --- | --- |
| Server URL | `https://mcp.broadnet.me/mcp` |
| Transport | Streamable HTTP (`--transport http` in Claude Code) |
| Authentication | `Authorization: Bearer <token>` header |
| Token | A temporary key from **Integrations → MCP Integration** in the admin portal, or a permanent key from your account admin |

## Before you start

1. Get a key: in the admin portal open **Integrations → MCP Integration** and choose **Get temporary key**. Use a temporary key while you experiment.
2. Put it in an environment variable rather than typing it into commands you might share:

```bash title="Shell"
export BROADNET_TOKEN="paste-your-key-here"
```

## Add the server for yourself

```bash title="Claude Code"
claude mcp add --transport http omnichannels https://mcp.broadnet.me/mcp \
  --header "Authorization: Bearer $BROADNET_TOKEN"
```

Your shell expands `$BROADNET_TOKEN` when you run the command, so the key is stored in your local Claude Code configuration (`~/.claude.json`). Without a scope flag the server is available only to you in the current project. Add `--scope user` to make it available in every project.

Check the connection:

```bash title="Claude Code"
claude mcp list
claude mcp get omnichannels
```

Inside a Claude Code session, the `/mcp` command shows the server's status and its tools. To remove the server, run `claude mcp remove omnichannels`.

## Share it with your team

To give everyone working in a repository the same server without sharing a key, commit a project-scoped `.mcp.json` file and let each developer supply their own token through an environment variable. Claude Code expands `${VAR}` in the `url` and `headers` fields.

```json title=".mcp.json"
{
  "mcpServers": {
    "omnichannels": {
      "type": "http",
      "url": "https://mcp.broadnet.me/mcp",
      "headers": {
        "Authorization": "Bearer ${BROADNET_TOKEN}"
      }
    }
  }
}
```

You can also create this file with `claude mcp add --transport http omnichannels --scope project https://mcp.broadnet.me/mcp --header 'Authorization: Bearer ${BROADNET_TOKEN}'`; the single quotes keep your shell from expanding the variable. Claude Code asks each developer to approve project-scoped servers before it uses them.

## Control which tools run

By default Claude Code asks before it uses an MCP tool. Keep it that way for anything that sends: a send tool sends a real, billed message to a real person.

Permission rules in Claude Code's settings refer to MCP tools as `mcp__<server>__<tool>`. With the server named `omnichannels`, for example:

```json title=".claude/settings.json"
{
  "permissions": {
    "allow": ["mcp__omnichannels__get_*"],
    "deny": []
  }
}
```

This lets tools whose names start with `get_` (read tools such as the delivery report lookup) run without a prompt, while every other tool, including all send tools, still asks. Tool names depend on the server version and your account, so check them under `/mcp` before you write rules. Add a tool to `deny` to remove it completely. See Claude Code's [permissions documentation](https://code.claude.com/docs/en/permissions) for the full rule syntax.

## Things to ask

- "Use the omnichannels tools to list my approved WhatsApp templates, then write a TypeScript function that sends the `order_update` template with the fields it needs."
- "Send a test SMS from OmniDemo to my number 447700900123, then check its delivery report."
- "Read the delivery report for yesterday's campaign and summarise the failure reasons."

For writing integration code, also give Claude Code the [OpenAPI spec](/developers/openapi/) so it uses the exact request fields.

## Troubleshooting

| Symptom | Likely cause |
| --- | --- |
| `claude mcp list` shows the server as failed or needing authentication | The `Authorization` header is missing or the key is wrong or expired. Re-add the server with a fresh key. |
| `.mcp.json` server connects for you but not for a teammate | Their `BROADNET_TOKEN` variable is not set in the shell that starts Claude Code. |
| A tool call returns an API error | The tool acts with your account's permissions, sender IDs and balance. Check the error against [Errors and limits](/developers/errors-and-limits/). |

To check the endpoint and key outside Claude Code, run the `initialize` request shown on the [MCP server](/developers/mcp/#test-the-connection-without-a-client) page.

## Next steps

- [MCP server](/developers/mcp/): endpoint, keys and safe-use rules for every client.
- [Use the MCP server with Cursor](/developers/mcp-cursor/).
- [OpenAPI 3.1 spec](/developers/openapi/): the REST API behind the tools.
