Logo de MCP AMQP Transport

MCP AMQP Transport

Organização
amazon-mq

A SDK for running MCP over AMQP

Publicado poramazon-mq
Repositóriomcp-amqp-transport
IdiomaTypeScript
Forks
3
Estrelas
21
Ferramentas disponíveis
13
Tipo de transportestdio
Categorias
LicençaApache-2.0
Links
  • Conecte ferramentas a fluxos de trabalho de IA

    MCP AMQP Transport disponibiliza recursos MCP que podem ser usados por clientes e agentes de IA compatíveis.

  • Ferramentas disponíveis: 13

    Confira abaixo as ações que o cliente MCP pode executar, com nomes e descrições quando fornecidos pelo servidor.

  • Configuração pronta para copiar

    Use os exemplos de instalação para configurar este servidor no seu cliente MCP preferido.

  • Indicadores da comunidade de código aberto

    Estrelas: 21 e forks: 3 no repositório vinculado.

npm

MCP AMQP Transport [beta]

AMQP transport implementation for the Model Context Protocol (MCP), enabling MCP servers and clients to communicate over AMQP message brokers like RabbitMQ.

Benefits

  • Reduced Complexity: Message broker handles guaranteed delivery, automatic retries, error handling, and dead-letter queue (DLQ) management
  • Fault Tolerance: Messages are persisted, so if an MCP server fails, requests can be redelivered once the server recovers
  • Easy Scaling: Add more MCP server instances by simply binding additional queues to the exchange—the broker automatically load-balances requests
  • Extensibility: Tap into message flows for analytics, data lake storage, custom guardrails, security policies, and seamless integration with existing enterprise message bus infrastructure

Features

  • AMQP Transport Layer: Full implementation of MCP transport over AMQP 0.9.1 and AMQP 1.0 protocols
  • Client & Server Support: Both ClientAMQPTransport and ServerAMQPTransport classes for AMQP 0.9.1, plus ClientAMQP10Transport and ServerAMQP10Transport for AMQP 1.0
  • CLI Adaptors: Command-line tools to bridge stdio-based MCP servers/clients with AMQP (both protocols)
  • Interceptor Framework: Base class for building message interceptors
  • Flexible Configuration: Support for environment variables and direct configuration
  • TLS Support: Secure connections with AMQPS

Installation

bash
npm install -g @aws/mcp-amqp-transport

Usage

Using Transport Classes

You need to configure the following environment variables:

AMQP_HOSTNAME - AMQP broker hostname
AMQP_USERNAME - username for your broker
AMQP_PASSWORD - password for your broker
AMQP_PORT - AMQP broker port (default: 5672 for AMQP, 5671 for AMQPS) 
AMQP_USE_TLS - Use TLS connection (default: true)

Example:

bash
export AMQP_HOSTNAME=localhost
export AMQP_PORT=5672
export AMQP_USERNAME=guest
export AMQP_PASSWORD=guest
export AMQP_USE_TLS=false

AMQP 0.9.1 Transport (Default)

Server Transport
typescript
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { ServerAMQPTransport } from '@aws/mcp-amqp-transport';

const server = new Server(
  { name: 'my-server', version: '1.0.0' },
  { capabilities: {} }
);

// Configuration via environment variables
const transport = new ServerAMQPTransport({
  name: 'my-server',
  exchangeName: 'mcp-exchange'
  // hostname, port, username, password read from environment variables
});

await server.connect(transport);
Client Transport
typescript
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { ClientAMQPTransport } from '@aws/mcp-amqp-transport';

const client = new Client(
  { name: 'my-client', version: '1.0.0' },
  { capabilities: {} }
);

// Configuration via environment variables
const transport = new ClientAMQPTransport({
  serverName: 'my-server',
  exchangeName: 'mcp-exchange'
  // hostname, port, username, password read from environment variables
});

await client.connect(transport);

AMQP 1.0 Transport

Note: AMQP 1.0 support requires RabbitMQ with the AMQP 1.0 plugin enabled: rabbitmq-plugins enable rabbitmq_amqp1_0

Server Transport
typescript
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { ServerAMQP10Transport } from '@aws/mcp-amqp-transport';

const server = new Server(
  { name: 'my-server', version: '1.0.0' },
  { capabilities: {} }
);

// Configuration via environment variables
const transport = new ServerAMQP10Transport({
  name: 'my-server',
  exchangeName: 'mcp-exchange'
  // hostname, port, username, password read from environment variables
});

await server.connect(transport);
Client Transport
typescript
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
import { ClientAMQP10Transport } from '@aws/mcp-amqp-transport';

const client = new Client(
  { name: 'my-client', version: '1.0.0' },
  { capabilities: {} }
);

// Configuration via environment variables
const transport = new ClientAMQP10Transport({
  serverName: 'my-server',
  exchangeName: 'mcp-exchange'
  // hostname, port, username, password read from environment variables
});

await client.connect(transport);

Using CLI Adaptors

The package includes CLI tools for bridging stdio-based MCP implementations with AMQP. Both AMQP 0.9.1 and AMQP 1.0 adaptors are available.

AMQP 0.9.1 Adaptors (Default)

Server Adaptor

Wraps an existing stdio-based MCP server to communicate over AMQP:

bash
# Set environment variables
export AMQP_HOSTNAME=localhost
export AMQP_PORT=5672
export AMQP_USERNAME=guest
export AMQP_PASSWORD=guest
export AMQP_USE_TLS=false

mcp-server-amqp-adaptor \
  --serverName my-server \
  --exchangeName mcp-exchange \
  --command "npx" \
  --args "-y" "@modelcontextprotocol/server-everything" \
  --additional-metadata "region=us-east-1,env=prod"
Client Adaptor

Provides a stdio interface for MCP clients to connect to AMQP-based servers:

bash
# Set environment variables
export AMQP_HOSTNAME=localhost
export AMQP_PORT=5672
export AMQP_USERNAME=guest
export AMQP_PASSWORD=guest
export AMQP_USE_TLS=false

mcp-client-amqp-adaptor \
  --serverName my-server \
  --exchangeName mcp-exchange \
  --additional-metadata "clientType=web,version=1.0"

AMQP 1.0 Adaptors

Note: Requires RabbitMQ with AMQP 1.0 plugin enabled: rabbitmq-plugins enable rabbitmq_amqp1_0

Server Adaptor
bash
# Set environment variables
export AMQP_HOSTNAME=localhost
export AMQP_PORT=5672
export AMQP_USERNAME=guest
export AMQP_PASSWORD=guest
export AMQP_USE_TLS=false

mcp-server-amqp10-adaptor \
  --serverName my-server \
  --exchangeName mcp-exchange \
  --command "npx" \
  --args "-y" "@modelcontextprotocol/server-everything" \
  --additional-metadata "region=us-east-1,env=prod"
Client Adaptor
bash
# Set environment variables
export AMQP_HOSTNAME=localhost
export AMQP_PORT=5672
export AMQP_USERNAME=guest
export AMQP_PASSWORD=guest
export AMQP_USE_TLS=false

mcp-client-amqp10-adaptor \
  --serverName my-server \
  --exchangeName mcp-exchange \
  --additional-metadata "clientType=web,version=1.0"

Note: If you didn't install globally with -g, then you need to use npx.

Building Interceptors

bash
# Set environment variables
export AMQP_HOSTNAME=localhost
export AMQP_PORT=5672
export AMQP_USERNAME=guest
export AMQP_PASSWORD=guest
export AMQP_USE_TLS=false

Create custom message interceptors for monitoring, security, caching, or analytics:

typescript
import { InterceptorBase, MessageProcessStatus } from '@aws/mcp-amqp-transport';

class MonitoringInterceptor extends InterceptorBase {
  async proccessClientToMCPMessage(message: any): Promise<MessageProcessStatus> {
    console.log('Client -> MCP:', message);
    // Add monitoring logic here
    return MessageProcessStatus.FORWARD;
  }

  async proccessMCPToClientMessage(message: any): Promise<MessageProcessStatus> {
    console.log('MCP -> Client:', message);
    // Add monitoring logic here
    return MessageProcessStatus.FORWARD;
  }
}

// Configuration via environment variables
const interceptor = new MonitoringInterceptor({
  inExchange: 'mcp-exchange-in',
  outExchange: 'mcp-exchange-out'
  // hostname, username, password read from environment variables
});

await interceptor.start();

Configuration

The adaptors and SDK require an exchange to be specified on both the client and server. This is the key to decoupling mcp-client and mcp-server communication.

In mcp-client-amqp-adaptor, you specify the serverName, which is the MCP server you want to connect to, as well as the exchange to publish to and consume from. In mcp-server-amqp-adaptor, you declare the serverName as an identifier for the client and also specify an exchange to publish to and consume from.

If you set the exchangeName to be the same in both adaptors, then messages will go directly from client to server. You can monitor and control the flow using the broker engine.

However, you can extend the architecture by adding your own interceptor to process these messages. You can have an application that sits in the middle:

The client adaptor binds to exchange-A, and the server adaptor binds to exchange-B. The interceptor (you can use the interceptor SDK) will process and route messages between exchange-A and exchange-B.

All transport classes and CLI tools support configuration via:

  1. Direct options (highest priority)
  2. Environment variables (fallback)

Environment Variables

  • AMQP_HOSTNAME: AMQP broker hostname
  • AMQP_USERNAME: AMQP username
  • AMQP_PASSWORD: AMQP password
  • AMQP_PORT: AMQP broker port (default: 5672 for AMQP, 5671 for AMQPS)
  • AMQP_USE_TLS: Use TLS connection (default: true)

CLI Options

Both adaptors support the following additional options:

  • --additional-metadata: Custom metadata as key=value pairs (comma-separated) to include in message headers

Architecture

Message Flow

AMQP 0.9.1

Client -> [mcp.{serverName}.request] -> Server
Server -> [from-mcp.{serverName}.client-id.{clientId}] -> Client

Routing Keys:

  • Client to Server: mcp.{serverName}.request
  • Server to Client: from-mcp.{serverName}.client-id.{clientId}
  • Reply routing key: Passed in message headers as routingKeyToReply

AMQP 1.0

Client -> [exchange.{exchangeName}.mcp.{serverName}.request] -> Server
Server -> [exchange.{exchangeName}.{replyRoutingKey}] -> Client

Address Patterns:

  • Client sender address: exchange.{exchangeName}.mcp.{serverName}.request
  • Client receiver address: exchange.{exchangeName}.{replyRoutingKey}
  • Server receiver address: exchange.{exchangeName}.mcp.{name}.request
  • Server sender address: exchange.{exchangeName}.{routingKeyToReply} (per-message sender)
  • Reply routing key: Passed in message application properties as routingKeyToReply (without exchange prefix)

Message ID Handling

The transport automatically augments message IDs with client identifiers to support multiple concurrent clients:

  • Client sends message with id: 1
  • Transport augments to id: "client-uuid-1"
  • Server processes and responds with augmented ID
  • Transport normalizes back to id: 1 for client

API Reference

AMQP 0.9.1 Transports

ServerAMQPTransport

typescript
interface ServerAMQPTransportOptions {
  name: string;              // Server name
  exchangeName: string;      // AMQP exchange name
  hostname?: string;         // Broker hostname
  port?: number;            // Broker port
  username?: string;        // AMQP username
  password?: string;        // AMQP password
  useTLS?: boolean;         // Use TLS connection
}

ClientAMQPTransport

typescript
interface ClientAMQPTransportOptions {
  serverName: string;       // Target server name
  exchangeName: string;     // AMQP exchange name
  hostname?: string;        // Broker hostname
  port?: number;           // Broker port
  username?: string;       // AMQP username
  password?: string;       // AMQP password
  useTLS?: boolean;        // Use TLS connection
}

AMQP 1.0 Transports

ServerAMQP10Transport

typescript
interface ServerAMQP10TransportOptions {
  name: string;              // Server name
  exchangeName: string;      // AMQP exchange name
  hostname?: string;         // Broker hostname
  port?: number;            // Broker port
  username?: string;        // AMQP username
  password?: string;        // AMQP password
  useTLS?: boolean;         // Use TLS connection
}

ClientAMQP10Transport

typescript
interface ClientAMQP10TransportOptions {
  serverName: string;       // Target server name
  exchangeName: string;     // AMQP exchange name
  hostname?: string;        // Broker hostname
  port?: number;           // Broker port
  username?: string;       // AMQP username
  password?: string;       // AMQP password
  useTLS?: boolean;        // Use TLS connection
}

InterceptorBase

typescript
interface InterceptorOptions {
  inExchange: string;       // Input exchange
  outExchange: string;      // Output exchange
  hostname?: string;        // Broker hostname
  port?: number;           // Broker port
  username?: string;       // AMQP username
  password?: string;       // AMQP password
  useTLS?: boolean;        // Use TLS connection
}

enum MessageProcessStatus {
  FORWARD = 'forward',      // Forward message unchanged
  REJECT = 'reject',        // Reject message and send it back to the previous exchange
  ERROR = 'error',          // Error occurred
  DROP = 'drop',            // Drop message
  TRANSFORM = 'transform'   // Transform message and forward that instead
}

Development

Code Quality Tools

This project uses ESLint, Prettier, and TypeScript for code quality and consistency.

Available Scripts

bash
# Run linter
npm run lint

# Auto-fix linting issues
npm run lint:fix

# Check code formatting
npm run format:check

# Format code
npm run format

# Type checking
npm run type-check

# Run tests
npm test

# Build the project
npm run build

Pre-commit Hooks

The project uses Husky and lint-staged to automatically lint and format code before commits. This ensures all committed code meets quality standards.

Security

See CONTRIBUTING for more information.

License

This project is licensed under the Apache-2.0 License.

Instalação

TypingMind
{
  "mcpServers": {
    "mcp-amqp-transport": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-everything"
      ],
      "env": {
        "AMQP_HOSTNAME": "<AMQP_HOSTNAME>",
        "AMQP_USERNAME": "<AMQP_USERNAME>",
        "AMQP_PASSWORD": "<AMQP_PASSWORD>",
        "serverName": "<serverName>",
        "exchangeName": "<exchangeName>"
      }
    }
  }
}

Ferramentas disponíveis

  • echo

    Echoes back the input string

  • get-annotated-message

    Demonstrates how annotations can be used to provide metadata about content.

  • get-env

    Returns all environment variables, helpful for debugging MCP server configuration

  • get-resource-links

    Returns up to ten resource links that reference different types of resources

  • get-resource-reference

    Returns a resource reference that can be used by MCP clients

  • get-structured-content

    Returns structured content along with an output schema for client data validation

  • get-sum

    Returns the sum of two numbers

  • get-tiny-image

    Returns a tiny MCP logo image.

  • gzip-file-as-resource

    Compresses a single file using gzip compression. Depending upon the selected output type, returns either the compressed data as a gzipped resource or a resource link, allowing it to be downloaded in a subsequent request during the current session.

  • toggle-simulated-logging

    Toggles simulated, random-leveled logging on or off.

  • toggle-subscriber-updates

    Toggles simulated resource subscription updates on or off.

  • trigger-long-running-operation

    Demonstrates a long running operation with progress updates.

  • simulate-research-query

    Simulates a deep research operation that gathers, analyzes, and synthesizes information. Demonstrates MCP task-based operations with progress through multiple stages. If 'ambiguous' is true and client supports elicitation, sends an elicitation request for clarification.

Use o MCP de MCP AMQP Transport com vários modelos de IA

O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho. Assim, após conectar MCP AMQP Transport, é possível usá-lo com diferentes modelos de IA no TypingMind, em vez de configurá-lo separadamente para cada modelo. Este MCP é executado localmente no seu dispositivo por meio do conector MCP do TypingMind.

Guia de configuração para usar o conector local

Use esta opção quando o servidor MCP precisar acessar arquivos locais, aplicativos ou recursos privados no seu computador.

1

Abra as configurações de MCP

No TypingMind, acesse Configurações > Configurações avançadas > Model Context Protocol e selecione Configurar conector.

  1. Abra o TypingMind no navegador.
  2. Clique no ícone de Configurações.
  3. Acesse Configurações avançadas.
  4. Abra a seção Model Context Protocol.
  5. Clique em Configurar conector e selecione Este dispositivo.
Tela de configuração do conector MCP do TypingMind com a opção Este dispositivo selecionada
2

Execute o comando do conector

Selecione Este dispositivo, copie o comando do TypingMind e execute-o no Terminal. Mantenha o processo em execução enquanto usa o MCP.

  1. Copie o comando de configuração exibido pelo TypingMind.
  2. Abra o Terminal no macOS ou o Windows Terminal no Windows.
  3. Cole e execute o comando.
  4. Autorize a instalação do pacote se o Terminal pedir confirmação para continuar.
  5. Mantenha o processo em execução na janela do Terminal enquanto usa as ferramentas MCP.
3

Adicione MCP AMQP Transport como servidor

Quando o status do conector for Pronto, clique em Editar servidores e cole a configuração do servidor MCP.

  1. Aguarde até que o status do conector mostre Pronto.
  2. Clique em Editar servidores.
  3. Cole a configuração do servidor MCP de MCP AMQP Transport.
  4. Salve a lista de servidores.
  5. Se quiser confirmar que o conector ainda está pronto para uso, atualize a página.
Configurações de MCP do TypingMind mostrando um servidor ativo e o botão Editar servidores
{
  "mcpServers": {
    "mcp-amqp-transport": {
      "command": "npx",
      "args": [
        "-y",
        "@aws/mcp-amqp-transport"
      ]
    }
  }
}
4

Use a conexão com diferentes modelos

Salve a lista de servidores, abra Plugins, ative as ferramentas MCP de MCP AMQP Transport, selecione qualquer modelo de IA compatível no TypingMind e use as ferramentas no chat ou atribua-as a um agente de IA.

  1. Abra a página Plugins no TypingMind.
  2. Ative as ferramentas MCP de MCP AMQP Transport.
  3. Inicie um chat e escolha o modelo de IA que deseja usar.
  4. Use as ferramentas MCP no chat ou atribua-as a um agente de IA.
  5. Mude para outro modelo de IA sempre que necessário, sem reconectar o MCP.
Chat do TypingMind usando ferramentas MCP ativadas com um modelo de IA selecionado
Pode usar MCP AMQP Transport para me ajudar nesta tarefa?
MCP AMQP Transport
Claro. Já li.
Veja o que encontrei usando MCP AMQP Transport.

Perguntas frequentes

Para que serve o servidor MCP MCP AMQP Transport?

MCP AMQP Transport é um servidor MCP que permite que aplicativos de IA compatíveis se conectem a ferramentas externas e informações de contexto. No TypingMind, basta adicionar esse servidor MCP uma vez para disponibilizar suas ferramentas no seu espaço de trabalho com IA.

Posso usar o MCP MCP AMQP Transport com vários modelos de IA no TypingMind?

Sim. O TypingMind conecta as ferramentas MCP no nível do espaço de trabalho, permitindo usar MCP AMQP Transport com diferentes modelos de IA, como Claude, ChatGPT, Gemini ou outros modelos configurados no TypingMind, sem configurar o servidor MCP separadamente para cada modelo.

Por que usar o MCP MCP AMQP Transport com o TypingMind?

O TypingMind é uma das melhores interfaces de chat com LLMs porque reúne vários modelos de IA, prompts, plugins, agentes de IA, chaves de API e ferramentas MCP em um só espaço de trabalho. Com MCP AMQP Transport conectado, é possível usar suas ferramentas MCP nos seus modelos preferidos e manter seu fluxo de trabalho de chat organizado no TypingMind.

Como conecto o MCP MCP AMQP Transport ao TypingMind?

MCP AMQP Transport funciona por meio do conector MCP local do TypingMind. Essa é a melhor opção quando o servidor MCP precisa acessar arquivos locais, apps de desktop, ferramentas de linha de comando ou recursos privados no seu computador.

Quais ferramentas o MCP MCP AMQP Transport oferece no TypingMind?

Número de ferramentas MCP disponíveis em MCP AMQP Transport: 13. É possível ativá-las na página Plugins do TypingMind e usá-las no chat ou atribuí-las a agentes de IA.

Preciso compartilhar minhas chaves de API com o TypingMind para usar o MCP MCP AMQP Transport?

Não. O TypingMind prioriza o uso local e permite manter seus provedores de modelos, chaves de API, prompts e configuração MCP sob seu controle. Se MCP AMQP Transport exigir autenticação, adicione os cabeçalhos, as configurações OAuth ou a configuração local exigidos por esse servidor MCP ao criar a conexão.

architecture.md

Static document file exposed from /docs: architecture.md

extension.md

Static document file exposed from /docs: extension.md

features.md

Static document file exposed from /docs: features.md

how-it-works.md

Static document file exposed from /docs: how-it-works.md

instructions.md

Static document file exposed from /docs: instructions.md

startup.md

Static document file exposed from /docs: startup.md

structure.md

Static document file exposed from /docs: structure.md

simple-prompt

A prompt with no arguments

args-prompt

A prompt with two arguments, one required and one optional

completable-prompt

First argument choice narrows values for second argument.

resource-prompt

A prompt that includes an embedded resource reference

Servidores MCP relacionados

Ver lista completa

Crie seu próprio espaço de trabalho com IA agora

Inscreva-se na nossa newsletter para receber avisos sobre novos recursos e futuros sorteios 👇