Nexus MCP
MCP server for the Gatewarden Nexus platform. Provides the mediation layer between local agent runtimes and the Nexus HTTP API via the Model Context Protocol (stdio transport).
Install
npx @gwdn/nexus-mcp
Or add to your agent's MCP configuration (OpenCode, Claude Code, Cursor, etc.):
{
"mcpServers": {
"nexus": {
"command": "npx",
"args": ["-y", "@gwdn/nexus-mcp@latest"],
"env": {
"NEXUS_API_URL": "https://nexus.gatewarden.eu",
"NEXUS_PRIVATE_TOKEN": "nxs_pat_..."
}
}
}
}
Architecture
The server exposes 62 tools across 4 layers. All data access goes through the Nexus HTTP API -- the MCP server has no direct database access.
Agent Runtime (OpenCode, Claude, Cursor, ...)
|
| stdio (MCP protocol)
v
nexus-mcp (this package)
|
| HTTPS (Bearer token auth)
v
Nexus API (nexus.gatewarden.eu)
|
v
Supabase (PostgreSQL + RLS)
Layer 1 -- Knowledge Access (6 tools)
| Tool | Description |
|---|---|
kb_search | Full-text, semantic, or hybrid search across project entities |
kb_memory | Structured project memory snapshot (ADRs, tasks, sessions, letters, customer docs) |
kb_get | Retrieve a specific entity by type and ID |
kb_related | Find entities related to a given entity |
project_list | List accessible projects |
project_update | Patch a project's readme and/or description (partial update). description is one short plain-text sentence (listing subtitle); long-form Markdown goes into readme |
Layer 2 -- Coordination (48 tools)
| Group | Tools |
|---|---|
| Vault Letters | vl_create, vl_reply, vl_inbox, vl_outbox, vl_ack |
| Dispatches | dispatch_create, dispatch_reply, dispatch_inbox, dispatch_outbox, dispatch_ack, dispatch_assign, dispatch_forward, dispatch_resolve, dispatch_close, dispatch_sweep, dispatch_get, dispatch_related |
| Tasks | task_create, task_update, task_note, task_list, task_delete |
| Documents | doc_ingest, doc_list, doc_classify, doc_update, doc_delete |
| Sessions | session_create, session_append, session_close, session_list |
| Decision Comments | dc_add, dc_list |
| Skills | sk_list, sk_get, sk_create, sk_update, sk_activate, sk_assign, sk_unassign, sk_export |
| Directives | pd_list, pd_get, pd_create, pd_update, pd_delete, pd_toggle, directive_export |
Directives: short binding rules (ADR-0125)
A directive is one short binding rule. pd_list returns the effective list per
project, and every entry carries a source:
source | Origin | Editable via pd_update |
|---|---|---|
mandatory | Platform catalog, always active | no |
flag | Platform catalog, switched by a project setting (nexus env set policy.<key>) | no |
template | Default/optional catalog rule added to the project | enabled only |
project | Rule written for this project | yes |
Fields for pd_create / pd_update:
| Field | Notes |
|---|---|
rule | One imperative sentence, at most 240 characters. Always rendered to agents. |
rationale | Background, at most 2000 characters. Never sent to agents. |
level | must | should |
category | commits | language | docs | security | workflow | operations | communication |
sort_order | Integer, ascending |
enabled | Boolean |
template_slug / template_id | pd_create only: add a default/optional catalog rule instead of writing your own. Cannot be combined with rule fields. |
title, body and priority are deprecated aliases for rule, rationale and
level (high maps to must). The backend no longer accepts the legacy
general category.
// project rule
{ "rule": "Write commit messages in English.", "level": "must", "category": "commits" }
// catalog rule
{ "template_slug": "<catalog-slug>" }
Skills: description and invocation (ADR-0124)
sk_create requires description (1 to 500 characters, not blank): one line
saying what the skill does and when to use it. Agents pick skills by it.
sk_create and sk_update accept an optional invocation:
model(default): the agent may load the skill on its own.user: only on explicit request (/command); rendered asdisable-model-invocationfor Claude Code.
Layer 3 -- Governance (3 tools)
| Tool | Description |
|---|---|
adr_create | Create a new ADR in draft status |
adr_submit | Submit a draft ADR for review |
adr_decide | Accept or reject an ADR under review |
Layer 4 -- Reviews (5 tools)
| Tool | Description |
|---|---|
rv_list | List reviews with optional filters |
rv_get | Get review details by ID or entity |
rv_create | Create a new review for a skill or agent |
rv_decide | Transition a review state (submit, accept, reject, ...) |
rv_comment | Add a comment to a review |
Authentication
Identity is resolved once at startup via GET /api/mcp/identity using the
NEXUS_PRIVATE_TOKEN as a Bearer token. All subsequent API calls use the same
token for authentication. The Nexus backend resolves the token to a user
identity and enforces project-scoped RBAC.
Environment Variables
| Variable | Required | Description |
|---|---|---|
NEXUS_API_URL | yes | Nexus API base URL (e.g. https://nexus.gatewarden.eu) |
NEXUS_PRIVATE_TOKEN | yes | nxs_pat_* API token for identity resolution |
NEXUS_MODEL | no | Model identifier for session metadata enrichment |
NEXUS_TOOLSTACK | no | Toolstack identifier (e.g. opencode, claude-code) |
Development
Recommended: Devbox
We recommend using Devbox to get a fully reproducible, isolated development environment with all required tools pre-installed (Node.js 22, git, ripgrep, tmux, lazygit, and more).
Install Devbox (once, system-wide):
curl -fsSL https://get.jetify.com/devbox | bash
Enter the dev shell:
devbox shell
This drops you into a Nix-managed shell with every tool pinned to the versions declared in devbox.json. No global installs, no version drift.
Available Devbox scripts:
| Script | Command | Description |
|---|---|---|
dev | devbox run dev | Start MCP server via tsx (watch mode) |
build | devbox run build | Compile TypeScript to dist/ |
test | devbox run test | Run full test suite |
typecheck | devbox run typecheck | TypeScript type-check only |
validate | devbox run validate | Full pre-commit validation (typecheck + tests) |
check-local | devbox run check-local | Local environment health check |
sec-scan | devbox run sec-scan | Security scan (gitleaks + audit) |
tmux-2w | devbox run tmux-2w | Open 2-window tmux workspace |
tmux-3w | devbox run tmux-3w | Open 3-window tmux workspace |
Without Devbox, you can still run commands directly:
npm install
npm run typecheck # TypeScript check
npm test # Run tests (164 unit + 34 E2E)
npm run build # Compile to dist/
npm run dev # Run via tsx (development)
npm start # Run compiled JS (production)
Project Structure
nexus-mcp/
├── src/
│ ├── server.ts # MCP server entry point (stdio transport)
│ ├── auth.ts # Token-based identity resolution via Nexus API
│ ├── nexus-api.ts # HTTP client for Nexus API (nexusGet, nexusPost)
│ ├── machine-id.ts # Machine identification for session metadata
│ ├── project-scope.ts # NEXUS_PROJECT_ID fallback for project-scoped tools
│ ├── version.ts # Package version for MCP serverInfo (read from package.json)
│ ├── tools/ # 27 tool modules (62 tools total)
│ └── __tests__/ # 17 test files (205 unit + 34 E2E)
├── LICENSE # Apache-2.0
├── SECURITY.md # Security policy
├── CONTRIBUTING.md # Contribution guidelines
└── CODE_OF_CONDUCT.md # Contributor Covenant
Known Issues
npx cache prevents version upgrade
When using npx to run the MCP server, npm caches the resolved package in
~/.npm/_npx/. Subsequent invocations may continue to use the cached
(outdated) version even after a new release is published.
Symptoms: MCP tools report an older version, or new tools/fixes are missing.
Fix: Clear all npx caches for this package before starting your agent:
find ~/.npm/_npx -path "*/node_modules/@gwdn/nexus-mcp" -type d \
-exec rm -rf {} + 2>/dev/null
Tip: Pin
@latestin your MCP config args to always resolve the newest version:["--yes", "@gwdn/nexus-mcp@latest"]
Related
- Gatewarden Nexus -- Platform (Next.js / Supabase)
- nexus-cli -- Workspace CLI (Rust)
- nexus-link -- Hardware agent (Rust)
License
Apache-2.0 -- Copyright (c) 2026 RelicFrog Holding UG (haftungsbeschraenkt)