MCP-Bastion 4.0.0

MCP-Bastion Documentation

Multi-language suite

MCP-Bastion (this repo) is the security engine published as mcp-bastion-python on PyPI—middleware, pillars, dashboard, CLI (validate, scan, serve --proxy, …).

mcp-bastion-suite is the multi-language connector layer: shared bastion.yaml, language adapters, tutorials, Docker, and a GitHub Action. It does not vendor Bastion source; the engine always comes from PyPI.

Prerequisite (D-3): Java / Go / .NET / suite adapters invoke the mcp-bastion Python CLI at runtime. Install the engine first and confirm mcp-bastion doctor reports cli_on_path OK — a missing Python/mcp-bastion on PATH fails at run time, not build time.

Honest scope today: full in-process pillars are Python. Scan / red-team / serve --proxy work for any language over MCP HTTP. Suite Java / Go / .NET adapters are CLI wrappers around the Python engine (require mcp-bastion / Python on PATH — run mcp-bastion doctor early). @mcp-bastion/core (Node) has native rate limiting; ML pillars need a Python sidecar URL (sidecarUrl / MCP_BASTION_URL) and fail closed if prompt guard is enabled without one. The suite TypeScript package is a config helper only — use @mcp-bastion/core for runtime. See MULTI-LANGUAGE-STRATEGY.md.

Keep deep language tutorials and framework packs in the suite repo so this README stays light. This page is the bridge.


How the two repos relate

┌─────────────────────────────────────────────────────────┐
│  Your app (Nest, Spring, FastAPI, .NET, Go, Rust, …)    │
└───────────────────────────┬─────────────────────────────┘
                            │
        ┌───────────────────▼───────────────────┐
        │  mcp-bastion-suite                       │
        │  adapters · YAML/CLI · sidecar · proxy   │
        │  https://github.com/vaquarkhan/mcp-bastion-suite
        └───────────────────┬───────────────────┘
                            │  bastion.yaml (shared policy)
                            ▼
        ┌───────────────────────────────────────┐
        │  mcp-bastion-python  (this project)     │
        │  Scan → Test → Enforce · dashboard      │
        │  pip install mcp-bastion-python         │
        └───────────────────────────────────────┘
Repo Role
MCP-Bastion Engine + Python middleware + docs site + attack demos
mcp-bastion-suite Connectors for every language / framework

Engine contract in the suite: docs/PYPI_ENGINE.md.

Org-friendly registry audit: PACKAGE_REGISTRY_STATUS.md — what is on PyPI / npmjs / Maven Central / NuGet.org / GHCR (and what is still missing).


Install matrix (suite)

You use Install
Python engine pip install mcp-bastion-python
Suite CLI pip install "git+https://github.com/vaquarkhan/mcp-bastion-suite.git" then mcp-bastion-suite doctor
Node / TypeScript npm GitHub Packages @vaquarkhan/mcp-bastion-suite or download .tgz from Release v0.1.0
Java / Kotlin Not on Maven Central — see Java JAR below
Go go get github.com/vaquarkhan/mcp-bastion-suite/adapters/go@v0.1.0
.NET NuGet GitHub Packages McpBastionSuite or .nupkg from Release v0.1.0
Any / CI ghcr.io/vaquarkhan/mcp-bastion-suite or GitHub Action

Full commands: suite DOWNLOADS.md · Release assets: v0.1.0

Java / Kotlin (Maven JAR)

The adapter JAR is published as a GitHub Release asset, not Maven Central. That is why search.maven.org / Maven Central UI will not show it.

Option A — download JAR (no registry auth)

https://github.com/vaquarkhan/mcp-bastion-suite/releases/download/v0.1.0/mcp-bastion-suite-0.1.0.jar
https://github.com/vaquarkhan/mcp-bastion-suite/releases/download/v0.1.0/pom.xml

Install into your local Maven repo:

mvn install:install-file \
  -Dfile=mcp-bastion-suite-0.1.0.jar \
  -DpomFile=pom.xml \
  -DgroupId=io.github.vaquarkhan \
  -DartifactId=mcp-bastion-suite \
  -Dversion=0.1.0 \
  -Dpackaging=jar

Then in pom.xml:

<dependency>
  <groupId>io.github.vaquarkhan</groupId>
  <artifactId>mcp-bastion-suite</artifactId>
  <version>0.1.0</version>
</dependency>

Option B — GitHub Packages (needs a PAT with read:packages; package visibility may be private until set Public in GitHub → Packages)

<repositories>
  <repository>
    <id>github</id>
    <url>https://maven.pkg.github.com/vaquarkhan/mcp-bastion-suite</url>
  </repository>
</repositories>

~/.m2/settings.xml:

<server>
  <id>github</id>
  <username>YOUR_GITHUB_USERNAME</username>
  <password>YOUR_PAT_WITH_read:packages</password>
</server>

Important: The Java adapter is a thin connector. The security engine is still mcp-bastion-python (CLI / sidecar / proxy). Install the engine:

pip install "mcp-bastion-python>=4.0.0,<5"
## or use suite Docker: ghcr.io/vaquarkhan/mcp-bastion-suite:0.1.0

Tutorial: suite java.md

Shared policy sketch (same file in every language):

prompt_guard:
  enabled: true
  threshold: 0.85
  heuristic_fallback: true
pii:
  enabled: true
rate_limit:
  enabled: true
  max_iterations: 15
  timeout_seconds: 60
mode: enforce
cp bastion.yaml.example bastion.yaml   # from the suite clone
mcp-bastion-suite validate --config bastion.yaml
mcp-bastion-suite scan examples/_shared/data/tools.json --format json -o .bastion/scan/catalog.json

How each language works

All languages share one policy and one engine. Adapters differ only in how traffic reaches Bastion (in-process Python vs sidecar/proxy).

Language How it works Suite tutorial Runnable example
Any (YAML) CLI validate/scan/doctor; enforce via proxy yaml.md examples/declarative
Python / FastMCP In-process mcp-bastion-python middleware python.md · fastmcp.md frameworks/python
TypeScript (Nest / Express / Fastify) Adapter + sidecar / shared yaml typescript.md frameworks/typescript
Java (Spring Boot / Spring AI / Quarkus / Micronaut) Java adapter + proxy to PyPI engine java.md · spring-boot.md frameworks/java · spring-boot
Kotlin Same Maven artifact; Ktor / Spring kotlin.md frameworks/kotlin
Go Go adapter + proxy go.md frameworks/go
.NET NuGet adapter + proxy dotnet.md frameworks/dotnet
Rust YAML + CLI + proxy (no native engine fork) rust.md frameworks/rust
Third-party MCP HTTP boundary only proxy.md

Architecture deep dive: suite MULTI_LANGUAGE.md.
Tutorial index: suite docs/tutorials.

Typical non-Python path

  1. Author bastion.yaml (same as Python).
  2. mcp-bastion-suite validate / scan in CI (Action or Docker).
  3. Run engine as proxy/sidecar (mcp-bastion serve --proxy or suite helper).
  4. Point Nest/Spring/.NET/Go MCP HTTP traffic at the proxy—or use the language adapter that stamps edge auth and forwards.

Python teams can stay in-process (this repo’s FastMCP wrap) without the suite; the suite still helps if you want one CI story across languages.


Sample data & IDE


Feature parity

Validate, scan, red-team, dashboard, and runtime enforce are implemented by mcp-bastion-python. The suite unlocks that stack for other languages via adapters + shared policy.

Upgrade engine only:

pip install -U "mcp-bastion-python>=4.0.0"
mcp-bastion-suite --version   # if suite CLI installed

Docker / GitHub Action (suite)

docker pull ghcr.io/vaquarkhan/mcp-bastion-suite:0.1.0
docker run --rm -v "$PWD":/work -w /work ghcr.io/vaquarkhan/mcp-bastion-suite:0.1.0 \
  validate --config bastion.yaml
- uses: vaquarkhan/mcp-bastion-suite@main
  with:
    command: validate
    config: bastion.yaml

Where to go next

Goal Start here
Understand Bastion pillars USER_GUIDE.md · FEATURE_DEEP_DIVE.md
Run attack demos (Python) ATTACK_DEMOS.md
Adopt from Java/TS/Go/.NET mcp-bastion-suite → language tutorial
Proxy boundary GATEWAY_BOUNDARY.md · suite proxy.md