Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ MCP helpers
## Security & Configuration Tips
- Copy `.env.example` β†’ `.env`; verify with `make check-env`. Never commit secrets.
- Auth: set `JWT_SECRET_KEY`; export `MCPGATEWAY_BEARER_TOKEN` using the token utility for API calls.
- Wrapper: set `MCP_SERVER_CATALOG_URLS` and `MCP_AUTH_TOKEN` when using `mcpgateway.wrapper`.
- Wrapper: set `MCP_SERVER_URL` and `MCP_AUTH` when using `mcpgateway.wrapper`.
- TLS: `make certs` β†’ `make serve-ssl`. Prefer environment variables for config; see `README.md`.
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ python3 -m mcpgateway.translate \
--stdio "uvx mcp-server-git" --port 9000

# Run the stdio wrapper for MCP clients
export MCP_AUTH_TOKEN=$MCPGATEWAY_BEARER_TOKEN
export MCP_SERVER_CATALOG_URLS=http://localhost:4444/servers/UUID
export MCP_AUTH=$MCPGATEWAY_BEARER_TOKEN
export MCP_SERVER_URL=http://localhost:4444/servers/UUID/mcp
python3 -m mcpgateway.wrapper
```

Expand Down
4 changes: 2 additions & 2 deletions DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
```bash
# Gateway & auth
export MCP_GATEWAY_BASE_URL=http://localhost:4444
export MCP_SERVER_CATALOG_URLS=http://localhost:4444/servers/UUID_OF_SERVER_1
export MCP_AUTH_TOKEN="<your_bearer_token>"
export MCP_SERVER_URL=http://localhost:4444/servers/UUID_OF_SERVER_1/mcp
export MCP_AUTH="<your_bearer_token>"
```

| Mode | Command | Notes |
Expand Down
60 changes: 35 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,22 +376,32 @@ npx -y @modelcontextprotocol/inspector
<summary><strong>πŸ–§ Using the stdio wrapper (mcpgateway-wrapper)</strong></summary>

```bash
export MCP_AUTH_TOKEN=$MCPGATEWAY_BEARER_TOKEN
export MCP_SERVER_CATALOG_URLS=http://localhost:4444/servers/UUID_OF_SERVER_1
export MCP_AUTH=$MCPGATEWAY_BEARER_TOKEN
export MCP_SERVER_URL=http://localhost:4444/servers/UUID_OF_SERVER_1/mcp
python3 -m mcpgateway.wrapper # Ctrl-C to exit
```

You can also run it with `uv` or inside Docker/Podman - see the *Containers* section above.

In MCP Inspector, define `MCP_AUTH_TOKEN` and `MCP_SERVER_CATALOG_URLS` env variables, and select `python3` as the Command, and `-m mcpgateway.wrapper` as Arguments.
In MCP Inspector, define `MCP_AUTH` and `MCP_SERVER_URL` env variables, and select `python3` as the Command, and `-m mcpgateway.wrapper` as Arguments.

```bash
echo $PWD/.venv/bin/python3 # Using the Python3 full path ensures you have a working venv
export MCP_SERVER_CATALOG_URLS='http://localhost:4444/servers/UUID_OF_SERVER_1'
export MCP_AUTH_TOKEN=${MCPGATEWAY_BEARER_TOKEN}
export MCP_SERVER_URL='http://localhost:4444/servers/UUID_OF_SERVER_1/mcp'
export MCP_AUTH=${MCPGATEWAY_BEARER_TOKEN}
npx -y @modelcontextprotocol/inspector
```

or

Pass the url and auth as arguments (no need to set environment variables)
```bash
npx -y @modelcontextprotocol/inspector
command as `python`
Arguments as `-m mcpgateway.wrapper --url "http://localhost:4444/servers/UUID_OF_SERVER_1/mcp" --auth "Bearer <your token>"`
```


When using a MCP Client such as Claude with stdio:

```json
Expand All @@ -401,8 +411,8 @@ When using a MCP Client such as Claude with stdio:
"command": "python",
"args": ["-m", "mcpgateway.wrapper"],
"env": {
"MCP_AUTH_TOKEN": "your-token-here",
"MCP_SERVER_CATALOG_URLS": "http://localhost:4444/servers/UUID_OF_SERVER_1",
"MCP_AUTH": "your-token-here",
"MCP_SERVER_URL": "http://localhost:4444/servers/UUID_OF_SERVER_1",
"MCP_TOOL_CALL_TIMEOUT": "120"
}
}
Expand Down Expand Up @@ -591,14 +601,14 @@ The `mcpgateway.wrapper` lets you connect to the gateway over **stdio** while ke
```bash
# Set environment variables
export MCPGATEWAY_BEARER_TOKEN=$(python3 -m mcpgateway.utils.create_jwt_token --username admin --exp 10080 --secret my-test-key)
export MCP_AUTH_TOKEN=${MCPGATEWAY_BEARER_TOKEN}
export MCP_SERVER_CATALOG_URLS='http://localhost:4444/servers/UUID_OF_SERVER_1'
export MCP_AUTH=${MCPGATEWAY_BEARER_TOKEN}
export MCP_SERVER_URL='http://localhost:4444/servers/UUID_OF_SERVER_1/mcp'
export MCP_TOOL_CALL_TIMEOUT=120
export MCP_WRAPPER_LOG_LEVEL=DEBUG # or OFF to disable logging

docker run --rm -i \
-e MCP_AUTH_TOKEN=$MCPGATEWAY_BEARER_TOKEN \
-e MCP_SERVER_CATALOG_URLS=http://host.docker.internal:4444/servers/UUID_OF_SERVER_1 \
-e MCP_AUTH=$MCPGATEWAY_BEARER_TOKEN \
-e MCP_SERVER_URL=http://host.docker.internal:4444/servers/UUID_OF_SERVER_1/mcp \
-e MCP_TOOL_CALL_TIMEOUT=120 \
-e MCP_WRAPPER_LOG_LEVEL=DEBUG \
ghcr.io/ibm/mcp-context-forge:0.5.0 \
Expand All @@ -615,8 +625,8 @@ Because the wrapper speaks JSON-RPC over stdin/stdout, you can interact with it

```bash
# Start the MCP Gateway Wrapper
export MCP_AUTH_TOKEN=${MCPGATEWAY_BEARER_TOKEN}
export MCP_SERVER_CATALOG_URLS=http://localhost:4444/servers/YOUR_SERVER_UUID
export MCP_AUTH=${MCPGATEWAY_BEARER_TOKEN}
export MCP_SERVER_URL=http://localhost:4444/servers/YOUR_SERVER_UUID
python3 -m mcpgateway.wrapper
```

Expand Down Expand Up @@ -667,8 +677,8 @@ python3 -m mcpgateway.wrapper

The `mcpgateway.wrapper` exposes everything your Gateway knows about over **stdio**, so any MCP client that *can't* (or *shouldn't*) open an authenticated SSE stream still gets full tool-calling power.

> **Remember** to substitute your real Gateway URL (and server ID) for `http://localhost:4444/servers/UUID_OF_SERVER_1`.
> When inside Docker/Podman, that often becomes `http://host.docker.internal:4444/servers/UUID_OF_SERVER_1` (macOS/Windows) or the gateway container's hostname (Linux).
> **Remember** to substitute your real Gateway URL (and server ID) for `http://localhost:4444/servers/UUID_OF_SERVER_1/mcp`.
> When inside Docker/Podman, that often becomes `http://host.docker.internal:4444/servers/UUID_OF_SERVER_1/mcp` (macOS/Windows) or the gateway container's hostname (Linux).

---

Expand All @@ -678,8 +688,8 @@ The `mcpgateway.wrapper` exposes everything your Gateway knows about over **stdi
```bash
docker run -i --rm \
--network=host \
-e MCP_SERVER_CATALOG_URLS=http://localhost:4444/servers/UUID_OF_SERVER_1 \
-e MCP_AUTH_TOKEN=${MCPGATEWAY_BEARER_TOKEN} \
-e MCP_SERVER_URL=http://localhost:4444/servers/UUID_OF_SERVER_1/mcp \
-e MCP_AUTH=${MCPGATEWAY_BEARER_TOKEN} \
-e MCP_TOOL_CALL_TIMEOUT=120 \
ghcr.io/ibm/mcp-context-forge:0.5.0 \
python3 -m mcpgateway.wrapper
Expand All @@ -697,8 +707,8 @@ docker run -i --rm \
pipx install --include-deps mcp-contextforge-gateway

# Run the stdio wrapper
MCP_AUTH_TOKEN=${MCPGATEWAY_BEARER_TOKEN} \
MCP_SERVER_CATALOG_URLS=http://localhost:4444/servers/UUID_OF_SERVER_1 \
MCP_AUTH=${MCPGATEWAY_BEARER_TOKEN} \
MCP_SERVER_URL=http://localhost:4444/servers/UUID_OF_SERVER_1/mcp \
python3 -m mcpgateway.wrapper
# Alternatively with uv
uv run --directory . -m mcpgateway.wrapper
Expand All @@ -713,8 +723,8 @@ uv run --directory . -m mcpgateway.wrapper
"command": "python3",
"args": ["-m", "mcpgateway.wrapper"],
"env": {
"MCP_AUTH_TOKEN": "<your-token>",
"MCP_SERVER_CATALOG_URLS": "http://localhost:4444/servers/UUID_OF_SERVER_1",
"MCP_AUTH": "<your-token>",
"MCP_SERVER_URL": "http://localhost:4444/servers/UUID_OF_SERVER_1/mcp",
"MCP_TOOL_CALL_TIMEOUT": "120"
}
}
Expand Down Expand Up @@ -750,8 +760,8 @@ source ~/.venv/mcpgateway/bin/activate
uv pip install mcp-contextforge-gateway

# Launch wrapper
MCP_AUTH_TOKEN=${MCPGATEWAY_BEARER_TOKEN} \
MCP_SERVER_CATALOG_URLS=http://localhost:4444/servers/UUID_OF_SERVER_1 \
MCP_AUTH=${MCPGATEWAY_BEARER_TOKEN} \
MCP_SERVER_URL=http://localhost:4444/servers/UUID_OF_SERVER_1/mcp \
uv run --directory . -m mcpgateway.wrapper # Use this just for testing, as the Client will run the uv command
```

Expand All @@ -770,8 +780,8 @@ uv run --directory . -m mcpgateway.wrapper # Use this just for testing, as the C
"mcpgateway.wrapper"
],
"env": {
"MCP_AUTH_TOKEN": "<your-token>",
"MCP_SERVER_CATALOG_URLS": "http://localhost:4444/servers/UUID_OF_SERVER_1"
"MCP_AUTH": "<your-token>",
"MCP_SERVER_URL": "http://localhost:4444/servers/UUID_OF_SERVER_1/mcp"
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/overview/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ npx -y @modelcontextprotocol/inspector
## Connect via `mcpgateway-wrapper` (stdio)

```bash
export MCP_AUTH_TOKEN=$MCPGATEWAY_BEARER_TOKEN
export MCP_SERVER_CATALOG_URLS=http://localhost:4444/servers/UUID_OF_SERVER_1
export MCP_AUTH=$MCPGATEWAY_BEARER_TOKEN
export MCP_SERVER_URL=http://localhost:4444/servers/UUID_OF_SERVER_1/mcp
python3 -m mcpgateway.wrapper # behaves as a local MCP stdio server - run from MCP client
```

Expand All @@ -221,8 +221,8 @@ Use this in GUI clients (Claude Desktop, Continue, etc.) that prefer stdio. Exam
"command": "python3",
"args": ["-m", "mcpgateway.wrapper"],
"env": {
"MCP_SERVER_CATALOG_URLS": "http://localhost:4444/servers/UUID_OF_SERVER_1",
"MCP_AUTH_TOKEN": "<YOUR_JWT_TOKEN>",
"MCP_SERVER_URL": "http://localhost:4444/servers/UUID_OF_SERVER_1/mcp",
"MCP_AUTH": "<YOUR_JWT_TOKEN>",
"MCP_TOOL_CALL_TIMEOUT": "120"
}
}
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/testing/acceptance.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ graph TB
| Feature | URL | Commands | Expected Result | Status | Notes |
|---------|-----|----------|-----------------|--------|-------|
| Install Package | `pip install mcp-contextforge-gateway` | Install for wrapper | Package installed | ☐ | If not already done |
| Set Environment | `export MCP_SERVER_CATALOG_URLS="$GW_URL/servers/$TIME_SERVER_UUID" && export MCP_AUTH_TOKEN=$MCPGATEWAY_BEARER_TOKEN` | Configure wrapper | Environment set | ☐ | Point to virtual server |
| Set Environment | `export MCP_SERVER_URL="$GW_URL/servers/$TIME_SERVER_UUID" && export MCP_AUTH=$MCPGATEWAY_BEARER_TOKEN` | Configure wrapper | Environment set | ☐ | Point to virtual server |
| Test Wrapper Init | `echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' \| python3 -m mcpgateway.wrapper 2>/dev/null \| jq` | Initialize via stdio | Returns capabilities with tools | ☐ | Stdio to HTTP bridge |
| List Tools via Wrapper | `echo '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' \| python3 -m mcpgateway.wrapper 2>/dev/null \| jq` | List tools via stdio | Returns tool list | ☐ | Wrapper functionality |

Expand All @@ -183,8 +183,8 @@ graph TB
"command": "python",
"args": ["-m", "mcpgateway.wrapper"],
"env": {
"MCP_SERVER_CATALOG_URLS": "$GW_URL/servers/$TIME_SERVER_UUID",
"MCP_AUTH_TOKEN": "$MCPGATEWAY_BEARER_TOKEN"
"MCP_SERVER_URL": "$GW_URL/servers/$TIME_SERVER_UUID",
"MCP_AUTH": "$MCPGATEWAY_BEARER_TOKEN"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/tutorials/argocd-helm-deployment-ibm-cloud-iks.md
Original file line number Diff line number Diff line change
Expand Up @@ -694,8 +694,8 @@ Add to your Claude Desktop configuration:
"command": "python",
"args": ["-m", "mcpgateway.wrapper"],
"env": {
"MCP_AUTH_TOKEN": "<MCPGATEWAY_BEARER_TOKEN>",
"MCP_SERVER_CATALOG_URLS": "https://mcp-gateway.<CLUSTER_INGRESS_SUBDOMAIN>/servers/UUID_OF_SERVER_1"
"MCP_AUTH": "<MCPGATEWAY_BEARER_TOKEN>",
"MCP_SERVER_URL": "https://mcp-gateway.<CLUSTER_INGRESS_SUBDOMAIN>/servers/UUID_OF_SERVER_1/mcp"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/using/agents/bee.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ To use MCP tools in the Bee Agent Framework, follow these steps:

```bash
export MCP_GATEWAY_BASE_URL=http://localhost:4444
export MCP_AUTH_TOKEN="your_bearer_token"
export MCP_AUTH="your_bearer_token"
```

---
Expand Down
16 changes: 8 additions & 8 deletions docs/docs/using/clients/claude-desktop.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ prompt and resource registered in your Gateway.
"command": "python3",
"args": ["-m", "mcpgateway.wrapper"],
"env": {
"MCP_SERVER_CATALOG_URLS": "http://localhost:4444/servers/UUID_OF_SERVER_1",
"MCP_AUTH_TOKEN": "<YOUR_JWT_TOKEN>",
"MCP_SERVER_URL": "http://localhost:4444/servers/UUID_OF_SERVER_1",
"MCP_AUTH": "<YOUR_JWT_TOKEN>",
"MCP_TOOL_CALL_TIMEOUT": "120"
}
}
Expand All @@ -46,8 +46,8 @@ prompt and resource registered in your Gateway.
"command": "docker",
"args": [
"run", "--rm", "--network=host", "-i",
"-e", "MCP_SERVER_CATALOG_URLS=http://localhost:4444/servers/UUID_OF_SERVER_1",
"-e", "MCP_AUTH_TOKEN=<YOUR_JWT_TOKEN>",
"-e", "MCP_SERVER_URL=http://localhost:4444/servers/UUID_OF_SERVER_1",
"-e", "MCP_AUTH=<YOUR_JWT_TOKEN>",
"ghcr.io/ibm/mcp-context-forge:0.5.0",
"python3", "-m", "mcpgateway.wrapper"
]
Expand All @@ -67,8 +67,8 @@ If you installed the package globally:
"command": "pipx",
"args": ["run", "python3", "-m", "mcpgateway.wrapper"],
"env": {
"MCP_SERVER_CATALOG_URLS": "http://localhost:4444/servers/UUID_OF_SERVER_1",
"MCP_AUTH_TOKEN": "<YOUR_JWT_TOKEN>"
"MCP_SERVER_URL": "http://localhost:4444/servers/UUID_OF_SERVER_1",
"MCP_AUTH": "<YOUR_JWT_TOKEN>"
}
}
```
Expand All @@ -94,8 +94,8 @@ If tools don't appear, open *File β–Έ Settings β–Έ Developer β–Έ View Logs* to s

| Var | Purpose |
| ------------------------- | ------------------------------------------------- |
| `MCP_SERVER_CATALOG_URLS` | One or more `/servers/{id}` endpoints (comma-sep) |
| `MCP_AUTH_TOKEN` | JWT bearer for Gateway auth |
| `MCP_SERVER_URL` | One or more `/servers/{id}` endpoints (comma-sep) |
| `MCP_AUTH` | JWT bearer for Gateway auth |
| `MCP_TOOL_CALL_TIMEOUT` | Per-tool timeout (seconds, optional) |
| `MCP_WRAPPER_LOG_LEVEL` | `DEBUG`, `INFO`, `OFF` (optional) |

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/using/clients/cline.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ To integrate Cline with your MCP Gateway:
"mcpgateway.wrapper"
],
"env": {
"MCP_SERVER_CATALOG_URLS": "http://localhost:4444",
"MCP_AUTH_TOKEN": "REPLACE_WITH_MCPGATEWAY_BEARER_TOKEN",
"MCP_SERVER_URL": "http://localhost:4444",
"MCP_AUTH": "Bearer REPLACE_WITH_MCPGATEWAY_BEARER_TOKEN",
"MCP_WRAPPER_LOG_LEVEL": "OFF"
}
}
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/using/clients/continue.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ There are **two ways** to attach Continue to a gateway:
"type": "sse",
"url": "http://localhost:4444/servers/UUID_OF_SERVER_1/sse",
"headers": {
"Authorization": "Bearer ${env:MCP_AUTH_TOKEN}"
"Authorization": "Bearer ${env:MCP_AUTH}"
}
}
}
Expand All @@ -57,7 +57,7 @@ There are **two ways** to attach Continue to a gateway:
*Generate a token*:

```bash
export MCP_AUTH_TOKEN=$(python3 -m mcpgateway.utils.create_jwt_token -u admin --secret my-test-key)
export MCP_AUTH=$(python3 -m mcpgateway.utils.create_jwt_token -u admin --secret my-test-key)
```

### Option B - Local stdio bridge (`mcpgateway.wrapper`)
Expand All @@ -79,8 +79,8 @@ pipx install --include-deps mcp-contextforge-gateway
"command": "python3",
"args": ["-m", "mcpgateway.wrapper"],
"env": {
"MCP_SERVER_CATALOG_URLS": "http://localhost:4444/servers/UUID_OF_SERVER_1",
"MCP_AUTH_TOKEN": "${env:MCP_AUTH_TOKEN}",
"MCP_SERVER_URL": "http://localhost:4444/servers/UUID_OF_SERVER_1",
"MCP_AUTH": "${env:MCP_AUTH}",
"MCP_TOOL_CALL_TIMEOUT": "120"
}
}
Expand Down
10 changes: 5 additions & 5 deletions docs/docs/using/clients/copilot.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ uv pip install mcp-contextforge-gateway # inside any uv/ve
"command": "python3",
"args": ["-m", "mcpgateway.wrapper"],
"env": {
"MCP_SERVER_CATALOG_URLS": "http://localhost:4444/servers/UUID_OF_SERVER_1",
"MCP_AUTH_TOKEN": "<YOUR_JWT_TOKEN>",
"MCP_SERVER_URL": "http://localhost:4444/servers/UUID_OF_SERVER_1/mcp",
"MCP_AUTH": "Bearer <YOUR_JWT_TOKEN>",
"MCP_TOOL_CALL_TIMEOUT": "120"
}
}
Expand All @@ -111,8 +111,8 @@ That's it - VS Code spawns the stdio process, pipes JSON-RPC, and you're ready t
"command": "docker",
"args": [
"run", "--rm", "--network=host", "-i",
"-e", "MCP_SERVER_CATALOG_URLS=http://localhost:4444/servers/UUID_OF_SERVER_1",
"-e", "MCP_AUTH_TOKEN=<YOUR_JWT_TOKEN>",
"-e", "MCP_SERVER_URL=http://localhost:4444/servers/UUID_OF_SERVER_1",
"-e", "MCP_AUTH=<YOUR_JWT_TOKEN>",
"ghcr.io/ibm/mcp-context-forge:0.5.0",
"python3", "-m", "mcpgateway.wrapper"
]
Expand Down Expand Up @@ -142,7 +142,7 @@ Copilot routes the call β†’ Gateway β†’ tool, and prints the reply.
* **Use SSE for production**, stdio for local/offline.
* You can manage servers, tools and prompts from the Gateway **Admin UI** (`/admin`).
* Need a bearer quickly?
`export MCP_AUTH_TOKEN=$(python3 -m mcpgateway.utils.create_jwt_token -u admin --secret my-test-key)`
`export MCP_AUTH=$(python3 -m mcpgateway.utils.create_jwt_token -u admin --secret my-test-key)`

---

Expand Down
Loading
Loading