@apinator/mcp
OfficialClick on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@@apinator/mcpPublish a test event to the orders channel and watch for it."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@apinator/mcp
Model Context Protocol server for Apinator. It lets an AI agent (Claude Code, Claude Desktop, Cursor, …) publish events, inspect channels and watch live traffic on your Apinator app, so it can build and debug realtime features end to end.
Setup
You need your app's ID, key, secret and cluster from the Apinator console. Node.js 18 or newer.
Claude Code
claude mcp add apinator \
-e APINATOR_APP_ID=your-app-id \
-e APINATOR_KEY=your-key \
-e APINATOR_SECRET=your-secret \
-e APINATOR_CLUSTER=eu \
-- npx -y @apinator/mcpClaude Desktop, Cursor and other clients (mcpServers JSON config)
{
"mcpServers": {
"apinator": {
"command": "npx",
"args": ["-y", "@apinator/mcp"],
"env": {
"APINATOR_APP_ID": "your-app-id",
"APINATOR_KEY": "your-key",
"APINATOR_SECRET": "your-secret",
"APINATOR_CLUSTER": "eu"
}
}
}
}Environment variables
Variable | Required | Description |
| yes | App ID |
| yes | API key |
| yes | API secret. Used to sign requests; never returned by any tool |
| yes | Region the app was created in, e.g. |
| no |
|
| no | REST base URL of a local or self-hosted data plane (default |
| no | WebSocket base URL of a local or self-hosted data plane (default |
The server checks these at startup and exits with a message naming anything missing or malformed.
Related MCP server: console-stream-mcp
Tools
Tool | What it does |
| Publish an event to a channel, or up to 100 channels. |
| Active channels (with at least one subscriber) and their subscriber counts, optionally filtered by |
| One channel's subscriber count, or |
| The |
| Connects over WebSocket, subscribes (signing private/presence auth itself), and collects events for |
Every tool except publish_event is annotated readOnlyHint, so clients can auto-approve them.
A typical end-to-end check an agent runs: start watch_channel on a channel, trigger the code path
that publishes (or call publish_event), and compare the payload with what the client expects.
On cache- channels the last event is replayed to new subscribers, so a watch started after a publish
still receives it.
Resources and prompts
apinator://docs/llms.txt: the Apinator docs index, fetched from https://apinator.io/llms.txt.apinator://reference/protocol: frames, system events, error codes, channel types and the auth signature.Prompt
add-realtime-feature: walks the agent through choosing channels, wiring the server and client SDKs, and verifying withwatch_channel.
Security
The secret stays in the server process. Tool results and errors are scrubbed of it, and API error bodies are shortened to a one-line message.
publish_eventreaches every subscriber of the channel. SetAPINATOR_READ_ONLY=1for an agent that should only look, or use a separate app for development.sign_channel_authproduces valid subscription signatures for any channel name. Only give the server to agents you would trust with your app's auth endpoint.
Development
npm install
npm run build
npm test # unit tests (mocked fetch, local fake WebSocket server)
npm run typecheck # src and testsReleases are cut by release-please from Conventional
Commits on main; the release PR bumps package.json, updates CHANGELOG.md and tags, and the
workflow then publishes to npm.
Maintainers with the Apinator backend checked out next to this repo (../../backend, or set
BACKEND_DIR) can run the integration test and the MCP inspector against a throwaway local stack:
./scripts/local-stack.sh up # builds the backend, starts Postgres/Redis in Docker on spare ports, seeds an app
npm run build && npm run test:integration
./scripts/local-stack.sh downlocal-stack.sh up writes the local credentials to .local-stack/env. It also sets
APINATOR_API_URL and APINATOR_WS_URL, which point the server at a non-production data plane.
License
MIT
Available Tools
5 toolsget_channelGet channelBRead-only
Get one channel's subscriber count. Reports active: false when nobody is subscribed to it.
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes | Channel name. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and openWorldHint=true, so safety is covered. The description does add one genuinely useful behavioral detail not available elsewhere - that `active: false` signals zero subscribers - but no output schema exists, so the burden of describing the returned payload is only partially met.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences, zero waste, with the core purpose front-loaded before the response-semantics detail. Nothing could be cut without losing information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a one-parameter read tool this is close to adequate, and the `active: false` note is a real addition. However, with no output schema, the description should say more about what else is returned (other fields, error behavior for unknown channels) than a single flag semantic.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% for the single `channel` parameter (name, length bounds, non-whitespace pattern), so the schema does the heavy lifting. The description mentions 'one channel' but adds no format or constraint detail beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Get one channel's subscriber count'), and the singular framing naturally separates it from the sibling list_channels. It doesn't explicitly name any sibling, so sibling differentiation is implied rather than stated.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this versus list_channels, watch_channel, or publish_event. The agent must infer from context that this is a single-channel detail lookup; there are no prerequisites or exclusions given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_channelsList channelsARead-only
List the app's active channels (channels with at least one subscriber right now) and their subscriber counts. Channels that nobody is subscribed to are not listed, even if events were published to them.
| Name | Required | Description | Default |
|---|---|---|---|
| prefix | No | Only return channels whose name starts with this, e.g. "presence-" or "private-". |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is covered. The description adds real behavioral value beyond that: results are subscriber-gated rather than existence-gated, and subscriber counts are returned, which prevents an agent from misreading an empty result as a failure. No permissions, ordering, or pagination behavior is disclosed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two tight sentences with zero filler. The active-channel rule is front-loaded, and the second sentence pre-empts the most likely source of confusion.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a one-optional-parameter read tool with no output schema, the description covers the return content (channel names plus subscriber counts) and the inclusion rule, which is most of what an agent needs. It is silent on result ordering, size limits, and whether prefix filtering is case-sensitive, leaving minor gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and the prefix parameter is documented in the schema with a concrete example ("presence-", "private-"). The description says nothing about filtering, so it adds no meaning beyond the schema — the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ("List the app's active channels") and immediately narrows the scope to channels with at least one current subscriber. The exclusion clause ("channels that nobody is subscribed to are not listed, even if events were published to them") separates it cleanly from siblings like get_channel, publish_event, and watch_channel.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The definition makes the selection condition explicit — use this when you want currently-subscribed channels — and warns that a channel you published to may legitimately be absent. It does not, however, name an alternative such as get_channel for inspecting a specific channel that isn't listed.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
publish_eventPublish eventA
Publish an event to one or more Apinator channels. Every client subscribed to those channels receives it immediately. On cache- channels the event is also stored and replayed to future subscribers. Pass exactly one of channel or channels.
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Event payload. An object or array is sent as JSON; a string is sent as-is (clients JSON-decode it if they can). | |
| name | Yes | Event name, e.g. "order-created". Names starting with "realtime:" are reserved. | |
| channel | No | Channel to publish to, e.g. "orders" or "private-user-42". | |
| channels | No | Several channels to publish the same event to (max 100). | |
| socket_id | No | Exclude this connection from receiving the event (the sender's own socket). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations declare readOnlyHint=false, openWorldHint=true, idempotentHint=false, and destructiveHint=false, so the safety profile is covered. The description adds non-obvious semantics the annotations cannot express: immediate fan-out to subscribers and that cache- channels persist and replay the event to future subscribers, which materially affects a publish decision.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, no waste, front-loaded with the core action and delivery behavior; the exclusivity constraint is placed last where a caller checks it before invoking. Every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a publish tool with no output schema, the description covers delivery, persistence/replay, and the channel selection rule, which is sufficient to call it correctly. It omits any mention of what the call returns or error behavior, but with no output schema and full annotation coverage that gap is minor.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline would be 3, but the description adds a genuine constraint absent from the schema: 'Pass exactly one of channel or channels.' The schema presents both as optional with no oneOf, so this mutual-exclusion rule is real value beyond the structured fields.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (publish) and resource (event) plus the target (Apinator channels), and describes the delivery mechanism: subscribers receive it immediately, cache- channels store and replay. This clearly distinguishes it from the read/auth siblings (list_channels, get_channel, watct_channel, sign_channel_auth).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives a clear operational rule ('Pass exactly one of channel or channels') and explains the delivery context that decides reach. There is no competing publish sibling to route against, so no explicit alternative/exclusion language is needed, but no when-not guidance is offered either.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
sign_channel_authSign channel authARead-only
Compute the auth signature a client needs to subscribe to a private- or presence- channel, exactly as your auth endpoint would return it. Useful for testing an auth flow or debugging a signature mismatch. Presence channels need channel_data with a user_id.
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes | A "private-" or "presence-" channel. | |
| socket_id | Yes | Socket id of a connected client, from realtime:connection_established (e.g. "node-eu-1.42"). | |
| channel_data | No | Presence member data, e.g. {"user_id":"42","user_info":{"name":"Ada"}}. Required for presence channels. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations cover the safety profile (readOnlyHint=true, openWorldHint=false). The description adds real context beyond that: it is a pure computation mirroring the auth endpoint's output, plus the presence-channel channel_data requirement. It doesn't state whether it produces side effects (it doesn't, implied by annotations) or the exact return shape, but the added behavioral context is solid.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three tight sentences, front-loaded with the core action, then use cases, then the one conditional requirement. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a no-output-schema tool, the description adequately conveys what is produced ('exactly as your auth endpoint would return it') and documents the input requirements. Only the literal return type/format is left implicit, which is a minor gap given the deterministic nature of the operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the schema already documents all three parameters with examples. The description reinforces the presence/channel_data link, but that fact is already in the schema's parameter description, so it adds little beyond baseline.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a precise verb and resource: compute the auth signature for a private- or presence- channel subscription. It is immediately distinguishable from all siblings (list_channels, get_channel, publish_event, watch_channel), none of which involve signing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives clear when-to-use context: 'testing an auth flow or debugging a signature mismatch.' It also flags the presence-channel condition for channel_data. No explicit when-not guidance or named alternatives, but the usage intent is unambiguous.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
watch_channelWatch channelARead-only
Subscribe to a channel over WebSocket and collect the events that arrive for a few seconds, then disconnect. Use it to confirm events are flowing, see payload shapes, or test a publish end to end (start the watch, then publish). Private and presence channels are signed automatically. On presence channels the watcher joins as a member, which other subscribers will see. Long watches report progress every few seconds.
| Name | Required | Description | Default |
|---|---|---|---|
| channel | Yes | Channel to subscribe to. | |
| seconds | No | How long to listen after subscribing (default 10, max 60). | |
| max_events | No | How many events to keep; later ones are counted but dropped (default 50, max 200). | |
| channel_data | No | Presence member data to join with. Defaults to a watcher identity. | |
| until_events | No | Stop early once this many events have arrived. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Beyond the annotations, it discloses meaningful behavior: private/presence channels are signed automatically, the watcher joins as a visible presence member, and long watches emit progress every few seconds. These are non-obvious side effects an agent needs, and they do not contradict readOnlyHint/openWorldHint.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Four sentences, front-loaded with what the tool does and followed by usage, side effects, and progress behavior. Every sentence carries distinct information with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With no output schema, the description adequately conveys the lifecycle and the presence/signing side effects, plus progress reporting. It could say more about what the collected events look like on return, but the essentials for correct invocation are present.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3, but the description adds real meaning beyond the schema: channel_data is characterized as presence member data ('the watcher joins as a member') and the drop-versus-count behavior of max_events is reinforced. It stops short of documenting until_events semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a precise verb+resource: subscribe to a channel over WebSocket, collect events, then disconnect. It is clearly distinguished from siblings like publish_event and list_channels, and even frames the publish/watch pairing explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives concrete when-to-use cases (confirm events are flowing, inspect payload shapes, test a publish end to end) including the ordering hint 'start the watch, then publish'. It does not state when NOT to use it or name sibling alternatives for those cases, so it falls short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v1.0.1- First observed
get_channel - First observed
list_channels - First observed
publish_event - First observed
sign_channel_auth - First observed
watch_channel
TDQS
Scored across 5 tools
Each tool occupies a clearly distinct niche: listing channels, reading one channel's state, publishing, generating auth signatures, and watching a WebSocket. The list_channels/get_channel pair is the only near-overlap and the descriptions make the aggregate-vs-single distinction explicit.
All five tools follow a consistent snake_case verb_noun pattern (list_channels, get_channel, publish_event, sign_channel_auth, watch_channel). The verbs are precise and non-redundant.
Five tools is well-scoped for a pub/sub service, with no filler. Each tool maps to a genuine capability (inspect, publish, authenticate, subscribe and observe) and none feels like a duplicate.
The surface covers the full agent-relevant lifecycle for a realtime channel service: discovery, inspection, publish, auth, and end-to-end observation. Minor gaps exist around channel lifecycle management and batch/multi-channel inspection, but core workflows are fully reachable.
Maintenance
Related MCP Connectors
Create and manage Hibira realtime apps (Pusher protocol compatible) from your AI agent.
Webhooks for AI agents: send events, manage endpoints, inspect and retry deliveries.
Build, test and publish agentic workflows from your AI client: approve steps, read tables, see runs.
Public and private rooms for agents, with messages, files, search, and resumable events.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceReal-time observability dashboard for monitoring AI agents in multi-agent development workflows, with live WebSocket updates of tool calls, sessions, and usage statistics.-
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents to access live console logs, errors, and network requests from web applications via a local WebSocket connection, without copying data to chat.2 npm19MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to browse, click, and debug real websites in the user's own signed-in browser or a dedicated Chrome instance, with only explicitly shared tabs reachable and revocable at any time. Exposes the full developer toolbox — console, network, sources, debugger, elements, performance and CPU/memory profiling, storage, service workers, coverage, emulation, accessibility, security, Lighthouse, and Playwright-test recording — as first-class tools callable in one step.39 npm1MIT
- AlicenseNot gradedqualityAmaintenanceEnables coding agents to publish and read events on channels, notify humans, and ask yes/no, multiple-choice, or free-text questions, returning answers as tool results.9 npmMIT