# MCP Gateway — NMQ.Architect

**What it is:** the central bridge between **DeepSeek V4** (cloud / local stack) and **Agent Studio** agents via [Model Context Protocol](https://modelcontextprotocol.io/).

**What it is not:** an official DeepSeek partnership product. NMQ.Architect is an independent NMQ product that *uses* DeepSeek V4 (nominative / fair use).

---

## Why Gateway (not “module #20”)

Agents need tools outside the chat box: repos, search, deploy, memory. MCP is how DeepSeek’s ecosystem connects those tools. Architect’s **MCP Gateway** is the first-class surface for:

| Capability | In Architect |
|------------|--------------|
| Catalog + presets | Curated servers + Enable |
| Custom stdio / URL | Add custom MCP server |
| Discover | Scan / refresh discovery cache |
| Multi-session | Concurrent live connections (capped) |
| Tools call | List tools + invoke |
| 1M context | Toggle synced with DeepSeek Performance |
| Cost glance | Est. $ vs GPT-4o on the same hub screen |

---

## Open it

1. Dashboard → **MCP Gateway** launch card (Bridge), or module **00**
2. Or Agent Studio → Tools / MCP settings (Cursor engine)

API base (local): `http://127.0.0.1:3101/api/mcp/`

| Method | Path | Role |
|--------|------|------|
| GET | `/api/mcp/servers` | Catalog + configured + `gateway` stats |
| GET | `/api/mcp/catalog` | Catalog only |
| GET | `/api/mcp/status` | Gateway sessions |
| POST | `/api/mcp/discover` | Refresh discovery |
| POST | `/api/mcp/servers/:id/enable` | Enable from catalog |
| POST | `/api/mcp/servers/:id/toggle` | On/off |
| GET | `/api/mcp/servers/:id/tools` | List tools |
| POST | `/api/mcp/servers/:id/call` | Call tool |
| POST/DELETE | `/api/mcp/servers`… | Custom CRUD |

Secrets: only `${ENV}` refs in config — values live in `.env`.

---

## DeepSeek-oriented presets

Bundled catalog highlights (not partnership claims):

- **brave-search** — web research
- **sequential-thinking** — structured reasoning (pairs with reasoner / thinking workflows)
- **memory** — multi-session memory graph
- **github / filesystem** — repo work
- **DV4-MCP / arikusi deepseek-mcp-server** — *external* community servers; install from their repos, then Enable or Add custom. Verify package names in upstream README.

---

## Agent Studio link

Enabled MCP tools can be referenced as skills: `mcp:<serverId>:<toolName>`.

1M Context checkbox on the Gateway hub mirrors the dashboard DeepSeek Performance toggle (`nmq_deepseek_1m`). Thinking Mode mirrors `nmq_deepseek_thinking` (see [CONTEXT-PACK.md](./CONTEXT-PACK.md)).

---

## SDK

Live tool sessions need:

```bash
npm install @modelcontextprotocol/sdk
```

Without the SDK, catalog/UI still works; connect/call returns `SDK_MISSING`.

---

## Legal

- Allowed: “uses DeepSeek V4”, MCP-compatible, scales with your hardware  
- Forbidden: official partner, DeepSeek product, fake endorsements  

*DeepSeek is a trademark of DeepSeek.*
