Skip to main content
Glama
ballerina-activemq-mcp-server

ballerina-activemq-mcp-server

ballerina-activemq-mcp-server

An MCP server that automates the full setup and deployment of Ballerina + Apache ActiveMQ (OpenWire/JMS) integrations inside a WSO2 Integrator (BI) workspace — from broker validation to a runnable, BI-low-code-ready project — with minimal user interaction.

It generates code against the ballerinax/activemq connector (v0.1.0, Ballerina 2201.12.10), matching the real connector API (Client / Listener / Caller / Transaction). See INSPECTION_NOTES.md for the Phase 0 API inspection this is built on.

Tools

Tool

Purpose

mq_validate_broker

TCP reachability to the OpenWire port (+ Jolokia console destination listing).

mq_scaffold_project

Main tool. Generate a complete BI-ready Ballerina project.

mq_write_config_toml

Write/rotate the broker Config.toml.

mq_add_queue

Add a queue producer/consumer helper module.

mq_add_topic

Add a topic (pub/sub) publisher helper module.

mq_add_listener

Add a Listener service — the polling-loop carrier — with ack-mode/transaction options.

mq_set_ack_mode

Change the acknowledgement mode on a listener service (edits the @activemq:ServiceConfig).

mq_build_project

Run bal build.

mq_deploy_project

Run bal run; returns PID (+ service URL).

Acknowledgement modes

ack_mode

Ballerina enum

Needs Caller?

Semantics

auto (default)

AUTO_ACKNOWLEDGE

no

auto-ack on successful onMessage return

client

CLIENT_ACKNOWLEDGE

yes

caller->acknowledge(message)

dups-ok

DUPS_OK_ACKNOWLEDGE

no

lazy ack, possible duplicates

transacted

SESSION_TRANSACTED

yes

caller->'commit() / 'rollback()

The ack mode is a compile-time annotation field, so it lives in listener.bal (not Config.toml). mq_set_ack_mode edits the source accordingly.

Related MCP server: MCP_INIT_MS_SegurosBolivar

Build

npm install
npm run build

Run

# stdio (default — for MCP clients that spawn the server)
npm start

# streamable HTTP, bound to 127.0.0.1
npm run start:http            # or: node dist/index.js --http --port 3000

Register with an MCP client (stdio)

{
  "mcpServers": {
    "ballerina-activemq": {
      "command": "node",
      "args": ["/absolute/path/to/ballerina-activemq-mcp-server/dist/index.js"]
    }
  }
}

What gets scaffolded

mq_scaffold_project writes a complete project under <bi_path>/<project_name>/:

Ballerina.toml · Dependencies.toml · Config.toml (+ .example, gitignored) · .gitignore
main.bal · listener.bal · transactions.bal · modules/<dest>/<dest>.bal
docker-compose.yml (apache/activemq-classic:6.2.0) · README.md
  • main.bal — configurable broker settings + activemq:Client producer/consumer demo.

  • listener.bal — the polling-loop carrier: a declarative service activemq:Service on mqListener per destination, ack mode baked into @activemq:ServiceConfig.

  • Virtual topics — publish to topic://VirtualTopic.<name>; consume the queue Consumer.<group>.VirtualTopic.<name>.

Design notes

This is JMS/OpenWire, not Kafka. Consumer groups, offset commits, partitions, and bootstrap.servers have no analog here and are intentionally absent — reliability comes from ack modes and transacted sessions. The closest thing to a consumer group is an ActiveMQ Virtual Topic, modeled as a queue naming convention. See INSPECTION_NOTES.md for the full rejected-Kafka-patterns rationale.

License

Apache-2.0

Available Tools

9 tools
mq_add_listenerAdd Listener serviceA

Add a message Listener service — the polling-loop carrier — to listener.bal. Generates a declarative service activemq:Service on mqListener with the correct @activemq:ServiceConfig (queueName/topicName, sessionAckMode, pollingInterval, receiveTimeout) and an onMessage that carries an activemq:Caller for client/transacted ack modes (with acknowledge or commit/rollback). Supports queue, topic (optionally durable), and virtual-topic (consumer_group) destinations. If transacted=true conflicts with ack_mode, transacted wins (SESSION_TRANSACTED) with a warning. Creates listener.bal if absent; otherwise appends the service (or replaces the file if overwrite=true).

Inputs: org_name (required), destination (required), project_name (required), project_path (required), +7 more.

mq_add_queueAdd queue moduleA

Add a queue helper module to an existing project: creates modules//.bal with send() and receive() functions wired to the JMS queue (point-to-point). The producer sends with Client.sendMessage(queueName, ..) and receives synchronously with Client.receiveMessage(queueName, timeout). Does not overwrite unless overwrite=true.

Inputs: org_name (required), queue_name (required), project_name (required), project_path (required), +1 more.

mq_add_topicAdd topic moduleA

Add a topic (pub/sub) helper module to an existing project: creates modules//.bal with a publish() function that sends to "topic://". Subscribers are created as Listener services (use mq_add_listener with type=topic, optionally durable=true + subscriber_name). Does not overwrite unless overwrite=true.

Inputs: org_name (required), topic_name (required), project_name (required), project_path (required), +3 more.

mq_build_projectBuild Ballerina projectA
Idempotent

Run bal build in a scaffolded project and report success or the compiler diagnostics. Verifies the Ballerina toolchain is installed first (bal version). Use offline=true to build against locally cached dependencies only. Does not modify source files.

Inputs: project_path (required), offline, timeout_ms.

mq_deploy_projectDeploy (run) Ballerina projectA

Run bal run for a scaffolded project as a detached background process and return its PID. Watches the process for wait_ms to catch an early crash (and report the output) before declaring it started. If service_port is given, also returns a composed service URL. The process keeps running after this call returns. Verifies the Ballerina toolchain first.

Inputs: project_path (required), wait_ms, service_port.

mq_scaffold_projectScaffold ActiveMQ BI projectA

MAIN tool. Generate a complete, runnable WSO2 Integrator (BI) Ballerina project that integrates with ActiveMQ via the ballerinax/activemq connector. Creates Ballerina.toml (with the connector pinned from the local repository), Config.toml (+ .example, gitignored), .gitignore, main.bal (producer/consumer client demo), listener.bal (the polling-loop carrier with one declarative service activemq:Service on mqListener per destination) when include_listener is set, transactions.bal when transacted is set, a modules// helper per destination, a docker-compose.yml (apache/activemq-classic), and a README. Acknowledgement mode is baked into the listener's @activemq:ServiceConfig. If transacted=true conflicts with ack_mode, transacted wins (SESSION_TRANSACTED) and a warning is returned. Writes files to disk.

Inputs: bi_path (required), org_name (required), destinations (required), project_name (required), +7 more.

mq_set_ack_modeSet acknowledgement modeA
DestructiveIdempotent

Set/update the acknowledgement mode on listener service(s) by editing listener.bal in place. Rewrites sessionAckMode in the @activemq:ServiceConfig annotation and regenerates the affected onMessage to match (adds/removes the activemq:Caller parameter and the acknowledge / commit+rollback calls). Targets one service by service_name, or all services when omitted. Ack mode cannot live in Config.toml (it is a compile-time constant), which is why this edits source. Modifies a .bal file.

Inputs: ack_mode (required), project_path (required), service_name, listener_file.

mq_validate_brokerValidate ActiveMQ brokerA
Read-onlyIdempotent

Check that an ActiveMQ broker is reachable at the given OpenWire URL. Performs a TCP connectivity probe to each endpoint (handles tcp://, ssl://, and failover:(...) forms). When list_destinations is true, also queries the ActiveMQ web-console Jolokia REST agent (default port 8161) to list current queues and topics, degrading gracefully to a TCP-only result if the console is unreachable. Read-only; makes no changes.

Inputs: password, username, broker_url, timeout_ms, +2 more.

mq_write_config_tomlWrite broker Config.tomlA
DestructiveIdempotent

Write or rotate the broker connection Config.toml for an existing project. Sets the [org.project] table with brokerUrl and (optionally) username/password. Note: the acknowledgement mode and transacted flag live in listener.bal (compile-time annotation), so ack_mode/transacted here are written only as documented mirror comments. Overwrites the existing Config.toml.

Inputs: org_name (required), project_name (required), project_path (required), ack_mode, +4 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool targets a distinct lifecycle stage or resource type: broker validation, project scaffolding, config writing, queue/topic/listener additions, ack mode editing, build, and deploy. The only similar pair (add_queue vs add_topic) is clearly differentiated by destination type (point-to-point vs pub/sub).

    Naming Consistency5/5

    All tool names follow the consistent 'mq_verb_noun' pattern with snake_case throughout. Examples include mq_validate_broker, mq_scaffold_project, mq_add_queue, mq_set_ack_mode, and mq_build_project. This uniform convention makes tool discovery and selection highly predictable.

    Tool Count5/5

    With 9 tools, the server is well-scoped for its purpose of managing an ActiveMQ Ballerina project lifecycle. The count is neither minimal (which would be vague) nor overwhelming, and each tool serves a clear, necessary function from validation through deployment.

    Completeness4/5

    The toolset covers the core lifecycle well: validate, scaffold, add components, configure, build, and deploy. Minor gaps exist such as the lack of a remove/teardown tool or a direct JMS message roundtrip test, but these are not critical for the primary scaffolding workflow and can be worked around via the generated code.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to set up, run, and manage Ballerina + Salesforce integrations inside a WSO2 Integrator workspace, providing 18 tools for OAuth2 token acquisition, project scaffolding, building, deploying, and stopping the integration service.
      18
      -
    • A
      license
      C
      quality
      C
      maintenance
      Enables AI assistants to manage ActiveMQ message brokers through MCP tools, supporting queue and topic operations, dynamic connection management, message browsing, and health monitoring.
      22
      17 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to connect to JMS brokers such as IBM MQ, ActiveMQ, Artemis, RabbitMQ, TIBCO, Solace, and WebLogic, browse queues non-destructively, inspect messages and queue depth, and optionally send or consume messages when read-only safeguards are disabled. It auto-discovers JMSToolBox configurations and loads broker client drivers dynamically.
      19 npm
      1
      Apache 2.0