# MCP Open Discovery With AMQP

> MCP Open Discovery Server with AMQP Transport

- **Type:** MCP server
- **Install:** `agentstack add mcp-nagual69-mcp-open-discovery-with-amqp`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [nagual69](https://agentstack.voostack.com/s/nagual69)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MPL-2.0
- **Upstream author:** [nagual69](https://github.com/nagual69)
- **Source:** https://github.com/nagual69/MCP-Open-Discovery-with-AMQP
- **Website:** https://www.linkedin.com/in/toby-schmeling-2200556/

## Install

```sh
agentstack add mcp-nagual69-mcp-open-discovery-with-amqp
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# MCP Open Discovery v2.0

**Enterprise Multi-Transport MCP Discovery & Automation Platform**

[▶ Executive Overview (One‑Pager)](./docs/Executive-One-Pager.md) • [Website](https://www.linkedin.com/in/toby-schmeling-2200556/) • [Architecture Diagram](./open_mcp_architecture.mmd)

**World’s first dynamic Model Context Protocol (MCP) discovery server with hot‑reloadable tool registry, pluggable marketplace, and secure AMQP transport layer.**

  
    
    
  

  Forging Intelligent Systems with Purpose
  Unified launch: MCP Open Discovery • AMQP Transport • VS Code Bridge
  
    Model Context Protocol
    ·
    MCP Open Discovery
    ·
    AMQP Transport
    ·
    VS Code AMQP Bridge
    ·
    LinkedIn Profile
  

## Why Choose MCP Open Discovery

| Capability | Enterprise Outcome |
| ---------- | ------------------ |
| **MCP 2025-11-25 Compliant** | Full implementation of latest Model Context Protocol specification with SSE resumability, session TTL, and Origin validation |
| Multi-Transport (HTTP • Stdio • AMQP) | Integrate AI + infra workflows across IDEs, services, message buses |
| Dynamic Tool Registry & Hot‑Reload | Zero-downtime extension & controlled change windows |
| Signed & Policy-Governed Plugins | Supply‑chain integrity + runtime dependency governance |
| Encrypted Credential & CMDB Layer | Secure operational memory with auditability |
| Capability Diff & Strict Modes | Prevent drift between declared vs. active capabilities |
| Sandbox & Allowlist Enforcement | Runtime risk reduction for third‑party extensions |
| Proxmox • SNMP • Zabbix • Nmap | Unified infrastructure discovery & monitoring fabric |
| Marketplace Analytics | Operational insight (policy distribution, signatures, sandbox adoption) |

---

## Backward Compatibility: MCP 2025-03-26 & 2025-11-25

**Default Mode (Out-of-box):** ServiceNow and legacy 2025-03-26 clients work without any changes. Sessions persist indefinitely unless explicitly deleted. **[→ See Backward Compatibility Guide](./docs/BACKWARD_COMPATIBILITY.md)** for configuration options and client integration patterns.

---

## MCP 2025-11-25 Compliance & HTTP Session Robustness

The HTTP transport implements the complete [Model Context Protocol specification (2025-11-25)](https://modelcontextprotocol.io/specification/2025-11-25) with production-ready session management:

### Session Management Features

- **Session TTL with Reconnection**: Sessions survive SSE disconnections for 10 minutes (configurable via `MCP_SESSION_TTL_MS`), enabling clients to reconnect with `Last-Event-ID` header without re-initialization
- **SSE Resumability (SEP-1699)**: Clients receive `retry` field indicating reconnection interval; server supports polling pattern with graceful disconnect/reconnect cycles
- **Origin Validation (Security)**: MUST respond with 403 Forbidden for invalid `Origin` headers per MCP specification security requirements (prevents DNS rebinding attacks)
- **Enhanced Diagnostics**: Comprehensive logging of session lifecycle events (creation, activity, expiration, closure) with session metadata tracking
- **Stateless Request Support**: One-off requests without session management for simple clients (e.g., ServiceNow integrations)

### Session Lifecycle

```
┌─────────────┐
│ Initialize  │  POST /mcp (no session ID)
│   Request   │  → Server creates session, returns MCP-Session-Id header
└──────┬──────┘
       │
       ▼
┌─────────────┐
│   Active    │  Subsequent requests include MCP-Session-Id header
│   Session   │  Activity refreshes TTL (default: 10 min from last activity)
└──────┬──────┘
       │
       ├──► SSE Stream Opens (GET /mcp)
       │    │
       │    ├──► Server MAY disconnect at will (sends retry field)
       │    │
       │    └──► Client reconnects with Last-Event-ID (within TTL)
       │         Session preserved, stream resumed
       │
       ├──► Explicit DELETE /mcp → Immediate cleanup
       │
       └──► TTL Expires → 404 on next request
            Client re-initializes (POST /mcp without session ID)
```

### Configuration

```bash
# Session management (default values shown)
MCP_SESSION_TTL_MS=600000          # 10 minutes
MCP_SSE_RETRY_MS=3000              # 3 seconds

# Security (MCP spec requirement)
MCP_VALIDATE_ORIGIN=true           # Enable Origin validation
MCP_ALLOWED_ORIGINS=http://localhost,http://127.0.0.1
```

### Client Compatibility

- **VS Code MCP Extension**: Fully compatible; reconnects automatically within TTL window
- **ServiceNow/Simple Clients**: Use stateless mode (omit `MCP-Session-Id` header)
- **Long-Running Integrations**: Benefit from session persistence across network disruptions

---

## AMQP Transport Integration (Enterprise Message Bus Mode)

The AMQP transport enables horizontally scalable, decoupled MCP request/response flows over RabbitMQ. This allows infrastructure discovery, monitoring enrichment, and AI agent orchestration to share a common secure event fabric.

### Architecture Highlights

- Topic-based exchanges for routing (`mcp.notifications`, per‑session routing exchange)
- Per-session ephemeral queues with TTL & auto-delete for isolation
- Structured routing keys: `mcp.request..` and notification fan-out (`mcp.notification.#`)
- Heartbeat exchange (`mcp.heartbeat`) for liveness & operational dashboards
- Idempotent lifecycle: SDK triggers `start()`; initialize response flows through AMQP channel
- Capability negotiation preserved across transports

### Enterprise Use Cases

| Use Case | Benefit |
| -------- | ------- |
| Cross-Datacenter Discovery | Route tool calls via AMQP without direct network exposure |
| AI Workflow Orchestration | Publish discovery outputs for downstream enrichment pipelines |
| Event-Driven Compliance | Trigger scans upon asset onboarding messages |
| Hybrid Ops Bridge | Link cloud + on‑prem systems using a uniform protocol layer |

### Operational Controls

- Override queue/exchange names via env (`AMQP_EXCHANGE`, `AMQP_QUEUE_PREFIX`)
- Fine-grained subscription patterns for security segmentation
- Supports concurrent transports (e.g., `TRANSPORT_MODE=http,amqp`)
- Health & heartbeat signals consumable by observability stacks

---

## Plugin & Marketplace Architecture

The platform ships with a policy-aware plugin marketplace enabling governed extensibility under strict integrity, signature, and sandbox controls.

### Integrity & Supply Chain

- Deterministic distribution hash (sha256) + per-file checksum coverage
- Lock file v2 enrichment: file counts, total bytes, coverage, policy snapshot, signature metadata
- Automatic migration of legacy lock descriptors

### Dependency Policies (`dependenciesPolicy`)

| Policy | Runtime Behavior | Typical Use |
| ------ | ---------------- | ----------- |
| bundled-only | All code self-contained | High-security zones |
| external-allowed | External requires permitted | Internal trusted extensions |
| external-allowlist | Only declared `externalDependencies` resolved | Controlled partner modules |
| sandbox-required | Allowlist + runtime sandbox (blocks eval/new Function/native addons) | Third-party / marketplace |

### Runtime Governance

- Capability diff with optional `STRICT_CAPABILITIES=1` enforcement
- Signature verification (RSA / Ed25519) via `PLUGIN_REQUIRE_SIGNED=1`
- Allowlisted module load gate + deny native `.node` binaries under sandbox mode
- Eval & dynamic function creation disabled when sandboxed

### Observability & Analytics

- Policy distribution & signature adoption metrics
- Sandbox adoption ratios for risk posture tracking
- On-demand integrity rescans (`tool_store_rescan_integrity`)

### Marketplace Tooling

| Tool | Purpose |
| ---- | ------- |
| `tool_store_list_policies` | Enumerate installed plugins + policy & signature status |
| `tool_store_show` | Detailed plugin manifest + lock metrics |
| `tool_store_rescan_integrity` | Recompute distribution hash & validate coverage |

Looking for custom discovery modules or private plugin distribution? Contact the maintainers to discuss secure supply‑chain onboarding.

---

## Enterprise Feature Matrix

| Domain | Feature | Description |
| ------ | ------- | ----------- |
| Security | Encrypted credentials | AES-256 encrypted store + audit log |
| Security | Policy-governed plugins | Runtime dependency & sandbox enforcement |
| Security | Signature verification | RSA & Ed25519 trusted key model |
| Compliance | Capability diff control | Detect & block undeclared tool exposure |
| Compliance | Audit-ready logs | Credential + plugin lifecycle events |
| Operations | Hot‑reload registry | Zero-downtime module updates |
| Operations | Multi-transport core | HTTP + AMQP + stdio concurrency |
| Operations | Health & heartbeat | /health endpoint + AMQP heartbeat exchange |
| Discovery | Proxmox, SNMP, Nmap, Zabbix | Unified multi-surface infrastructure mapping |
| Extensibility | Marketplace APIs | Install, inspect, rescan, govern plugins |
| Observability | Analytics snapshot | Policy/signature/sandbox adoption metrics |

---

# MCP Open Discovery v2.0 🚀🔥

  
  
  

Enterprise-grade Model Context Protocol (MCP) server for infrastructure discovery, lightweight CMDB, and tooling orchestration. Designed for security-conscious environments, built on the official MCP SDK, and deployable with containers by default.

  

  

  
  This project was substantially coded with AI under human direction and review. Code and architecture decisions were guided, verified, and integrated by humans.
  

## Overview

MCP Open Discovery provides a single MCP server that exposes a broad set of discovery, monitoring, and CMDB-style capabilities via tools. It uses a centralized tool registry with hot‑reload, an SQLite-backed persistent store for CIs, and a container-first deployment approach.

This README aims to describe current capabilities plainly and avoid over‑claiming. For regulated or large enterprise environments, please evaluate features in a staging environment before production use.

## Highlights

- Single MCP server instance shared by multiple transports
- Central tool registry with hot‑reload and modular categories
- SQLite-backed persistent memory/CMDB with manual and periodic saves
- Credential management with encryption and audit logging
- Structured logging and a health endpoint for basic observability

## Current Transport Support

- HTTP: supported and enabled by default on port 6270. Override with `HTTP_PORT` or `PORT` when needed.
- Stdio: supported for local/embedded scenarios
- AMQP (RabbitMQ): available; evaluated in practice. Suitable for non-interactive integrations. For IDE integrations, confirm MCP transport compliance in your environment.
- gRPC: not enabled; future consideration

Notes:

- Transport selection can be tailored per deployment. Validate AMQP behavior with your client stack before relying on it.

## OAuth 2.1 Authorization (Production)

The server supports OAuth 2.1 (RFC 6749/9728) for the HTTP transport. This is **disabled by default** and must be explicitly configured.

### Configuration
To enable OAuth, set the following environment variables:

```bash
OAUTH_ENABLED=true
OAUTH_INTROSPECTION_ENDPOINT=https://auth.example.com/realms/mcp/protocol/openid-connect/token/introspect
OAUTH_CLIENT_ID=mcp-resource-server
OAUTH_CLIENT_SECRET=your-client-secret
```

### Features
- **RFC 7662 Introspection**: Validates tokens against your Identity Provider (Keycloak, Auth0, etc.).
- **RFC 9728 Discovery**: Exposes `/.well-known/oauth-protected-resource` for clients to discover auth servers.
- **Scope Enforcement**: Enforces `mcp:read`, `mcp:tools`, etc. via `WWW-Authenticate` challenges.
- **Dev Mode**: If `OAUTH_ENABLED=true` but no introspection endpoint is set (and not in production), a mock validator accepts tokens starting with `mcp_`.

## Tooling Scope (overview)

The server typically registers 70+ tools across these categories (exact counts can vary by build):

- Memory (CMDB/persistence)
- Credentials
- Network (ping, DNS, HTTP fetch, routes, interfaces, ARP, etc.)
- Nmap scanning (capability-aware)
- SNMP discovery and inspection
- Proxmox cluster inspection
- Zabbix integration (inventory, metrics, events)
- Registry/Hot‑reload management
- Test/Debug utilities

Refer to the code under `tools/` for the authoritative list and schemas.

## Architecture basics

- Server: `mcp_open_discovery_server.js` creates a single MCP server instance and starts available transports.
- Registry: `tools/registry/index.js` centralizes tool loading/registration and hot‑reload management.
- Persistence: `tools/memory_tools_sdk.js` uses SQLite (via `tools/registry/database_layer.js`) to persist CI data.
- Credentials: encrypted storage with audit trails (see `tools/credentials_tools_sdk.js`).
- HTTP Transport: `tools/transports/core/http-transport.js` implements MCP 2025-11-25 specification with session TTL, SSE resumability, and Origin validation.
- Transport Manager: `tools/transports/core/transport-manager.js` orchestrates multi-transport lifecycle with singleton server pattern.

### Architecture diagram

- Full diagram (Mermaid): [open_mcp_architecture.mmd](./open_mcp_architecture.mmd)
- Tip: In VS Code, install a Mermaid preview extension to view it; you can also copy the content into a Markdown ```mermaid block for GitHub rendering.

Design considerations:

- Prefer least privilege (Docker capabilities vs. privileged mode for scans).
- Avoid duplicate registrations via a single server instance.
- Provide stable defaults with clear extension points.

## Quick start

Prerequisites: Docker Desktop (includes Docker Compose), Git

Windows (PowerShell):

```powershell
./rebuild_deploy.ps1
```

Linux/Mac (alternative):

```bash
docker compose -f src/docker/compose.yml up -d
```

Verify:

```bash
curl http://localhost:6270/health
```

### Runtime paths

- Data: `/home/mcpuser/app/data` (container volume)
- Logs: `/home/mcpuser/app/logs` (container volume)
- Plugins: default `/home/mcpuser/plugins` in containers (mounted volume). When running locally, defaults to `/plugins` then `/plugins` if needed. Override with `PLUGINS_ROOT` (must be writable).

### Minimal production compose

For a lean, production-only deployment of the MCP server:

- HTTP only:
  docker compose -f src/docker/compose.yml up -d
- With AMQP broker (RabbitMQ):
  docker compose -f src/docker/compose.yml --profile amqp up -d
  The unified deploy scripts auto-set `TRANSPORT_MODE`; if invoking Compose manually with AMQP, set `TRANSPORT_MODE=http,amqp`.

### Deployment scripts

- Windows:
  - Unified typed-runtime deploy: `./rebuild_deploy.ps1` (uses `src/docker/compose.yml`)
  - Profiles: `-WithAmqp`, `-WithOAuth`, `-WithSnmp`, `-WithZabbix`
  - Full lab stack: `-BuildAll`
  - Transport override: `-TransportMode stdio,http` or `-Stdio -Http -Amqp`
  - Remote Docker over SSH: `-Ssh user@host`
  - Project scoping: `-ProjectName `
  - Compatibility wrapper: `./rebuild_deploy_prod.ps1`
- Linux/macOS:
  - Unified typed-runtime deploy: `./rebuild_redeploy.sh` (uses `src/docker/compose.yml`)
  - Profiles: `--with-amqp`, `--with-oauth`, `--with-snmp`, `--with-zabbix`
  - Full lab stack: `--all`
  - Transport override: `--transport-mode stdio,http` or `--stdio --http --amqp`
  - Remote Docker over SSH: `--ssh user@host`
  - Project scoping: `--project-name ` or `COMPOSE_PROJECT_NAME`
  - Compatibility wrapper: `./rebuild_redeploy_prod.sh`

## Security notes

- Credentials are stored encrypted with audit logging; integrate with your secrets management process for production.
- CI persistence uses SQLite; apply host or volume encryption per policy if required.
- Network scanning tools (e.g., nmap) may require extra container capabilities; review `src/docker/compose.yml` before enabling.

## Operational notes

- Hot‑reload is supported for tool modules; validate in lower environments before promoting changes.
- Tool counts and schemas may evolve; use the MCP `tools/list` method to discover the current interface.
- AM

…

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [nagual69](https://github.com/nagual69)
- **Source:** [nagual69/MCP-Open-Discovery-with-AMQP](https://github.com/nagual69/MCP-Open-Discovery-with-AMQP)
- **License:** MPL-2.0
- **Homepage:** https://www.linkedin.com/in/toby-schmeling-2200556/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** yes
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-nagual69-mcp-open-discovery-with-amqp
- Seller: https://agentstack.voostack.com/s/nagual69
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
