@4da/mcp-server
# @4da/mcp-server
[](https://www.npmjs.com/package/@4da/mcp-server)
[](LICENSE)
[](https://nodejs.org/)
[](https://smithery.ai/server/@4da/mcp-server)
**Dependency intelligence for AI coding agents.** Live CVE scanning, dependency health checks, upgrade planning, ecosystem news, and persistent decision memory. Zero config, privacy-first.
```
You: "Check my dependency health"
Claude: Health: 72/100. 47 dependencies scanned, 3 vulnerable, 1 deprecated, 8 outdated.
CRITICAL openssl-sys 0.9.93 CVE-2025-4231 -> 0.9.96
HIGH serde 1.0.197 RUSTSEC-2026-12 -> 1.0.210
MEDIUM cookie 0.17.0 deprecated -> 0.18.1
Quick wins: 6 patch upgrades, 2 minor. Run upgrade_planner for full plan.
```
One command to install. No API keys. No accounts. No code leaves your machine.
## Install
```bash
claude mcp add 4da -- npx @4da/mcp-server
```
<details>
<summary><b>Cursor / Windsurf</b></summary>
Add to `~/.cursor/mcp.json` or `~/.windsurf/mcp.json`:
```json
{
"mcpServers": {
"4da": {
"command": "npx",
"args": ["@4da/mcp-server"]
}
}
}
```
</details>
<details>
<summary><b>VS Code (Copilot)</b></summary>
Add to `~/.vscode/mcp.json`:
```json
{
"servers": {
"4da": {
"type": "stdio",
"command": "npx",
"args": ["@4da/mcp-server"]
}
}
}
```
</details>
<details>
<summary><b>Claude Desktop</b></summary>
Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
```json
{
"mcpServers": {
"4da": {
"command": "npx",
"args": ["@4da/mcp-server"]
}
}
}
```
</details>
<details>
<summary><b>Auto-setup</b> (detects all installed editors)</summary>
```bash
npx @4da/mcp-server --setup
```
</details>
Then ask your AI: **"Check my dependency health"** or **"Scan for vulnerabilities"**
## How It Works
On startup, the server reads your manifest and lock files (`package.json`, `Cargo.toml`, `go.mod`, `pyproject.toml`), resolves exact dependency versions, and queries live APIs. It re-reads them whenever a lockfile changes, so a long-running server never answers for yesterday's dependency set. For npm it also checks what `node_modules` actually holds: an installed copy that differs from the lockfile is reported with its reinstall command, instead of hiding behind a patched lockfile.
- **OSV.dev** for known CVEs across all ecosystems
- **npm registry** for version freshness, deprecation status, and weekly downloads
- **crates.io sparse index** for Rust package versions (avoids the 1 req/s API limit)
- **PyPI JSON API** for Python package metadata with license normalization
- **Go module proxy** for Go module versions
- **Hacker News Algolia API** for ecosystem news filtered by your tech stack
Results are cached (24h for registry data, 1h for vulnerabilities, 30min for news) and rate-limited per source.
**What's sent over the network:** package names + versions, generic tech keywords. The same data visible in your `package.json`. No source code, no file paths, no personal data. Set `FOURDA_OFFLINE=true` to disable all network calls.
> The one exception: if you *explicitly* configure an OpenAI embedding provider (`FOURDA_EMBED_PROVIDER=openai`) for semantic recall, the decision/memory text you store is sent to OpenAI to be embedded. The default — no embedding provider, or a local Ollama one — keeps everything on your machine, and `FOURDA_OFFLINE=true` overrides it regardless.
**Ecosystems supported:** npm, crates.io (Rust), PyPI (Python), Go.
## What You Can Ask
```
"Check my dependency health" -> dependency_health
"Scan for vulnerabilities" -> vulnerability_scan
"Which deps should I upgrade first?" -> upgrade_planner
"What should I know before I start coding?" -> what_should_i_know
"What's happening in the ecosystem?" -> ecosystem_pulse
"What's my tech stack?" -> get_context
"Record a decision: we chose Postgres" -> decision_memory
"Does switching to MySQL align?" -> check_decision_alignment
"Remember: never use ORM for batch inserts" -> agent_memory
```
## All 14 Tools
### Dependency Security
| Tool | What it does |
|------|-------------|
| `vulnerability_scan` | Live CVE scanning via OSV.dev. Severity, fix versions, CVSS scores. |
| `dependency_health` | Health score (0-100) + version freshness, deprecation, CVE counts per dependency. |
| `upgrade_planner` | Ranked upgrade recommendations. Quick wins vs. breaking changes. Risk-sorted. |
### Intelligence
| Tool | What it does |
|------|-------------|
| `what_should_i_know` | Pre-task intelligence briefing: vulns, decisions, signals, ecosystem updates. |
| `ecosystem_pulse` | Live ecosystem news from Hacker News, filtered by your detected tech stack. |
| `get_context` | Your tech stack, resolved dependency versions, interests, detected topics. |
| `get_relevant_content`* | Scored content feed — articles, advisories, releases ranked by relevance. |
| `get_actionable_signals`* | Classified alerts: security advisories, breaking changes, trending repos. |
| `knowledge_gaps`* | Dependencies you use daily but never read about. Surfaces missed CVEs and updates. |
| `record_feedback`* | Save or dismiss items so 4DA can record explicit interaction history. |
### Decisions & Memory
| Tool | What it does |
|------|-------------|
| `decision_memory` | Record, query, and manage architectural decisions across sessions. |
| `check_decision_alignment` | Verify if a proposed technology change aligns with recorded decisions. |
| `agent_memory` | Persistent memory that survives across sessions, agents, and editors. |
### Identity
| Tool | What it does |
|------|-------------|
| `developer_dna`* | Your tech identity: primary stack, top dependencies, blind spots. |
*\* Requires the [4DA desktop app](https://4da.ai) for full data.*
## Standalone vs. Full Mode
The MCP server works without the desktop app. On first run it creates a local database and scans your project:
| Capability | Standalone | With 4DA Desktop |
|------------|-----------|-------------------|
| Vulnerability scanning (OSV.dev) | Yes | Yes |
| Dependency health (4 registries) | Yes | Yes |
| Upgrade planner | Yes | Yes |
| Ecosystem news (Hacker News) | Yes | Yes |
| Pre-task intelligence briefing | Yes | Yes |
| Tech stack detection + resolved versions | Yes | Yes |
| Decision memory + alignment checking | Yes | Yes |
| Agent memory (cross-session) | Yes | Yes |
| Scored content feed (20+ sources) | -- | Yes |
| Actionable signals + knowledge gaps | -- | Yes |
| The analysis layer (Signal Chains, Knowledge Gaps, temporal analysis) | -- | Yes |
> **[Download 4DA](https://github.com/4DA-Systems/4DA/releases/latest)** for the full experience.
## Transports
**stdio** (default) -- works with all MCP hosts:
```bash
npx @4da/mcp-server
```
**Streamable HTTP** -- for remote or multi-client setups:
```bash
npx @4da/mcp-server --http --port 4840
```
The HTTP transport binds to `127.0.0.1` by default and applies a `Host`-header
DNS rebinding guard to every request. Exposing it beyond this machine requires
a shared secret:
```bash
MCP_AUTH_SECRET=<same value as the relay's JWT_SECRET> \
MCP_ALLOWED_HOSTS=mcp.internal \
npx @4da/mcp-server --http --host 0.0.0.0
```
Without `MCP_AUTH_SECRET` a non-loopback bind is refused at startup. With it,
every request must carry a Bearer token whose HMAC-SHA256 signature verifies
against that secret, and the token's role is enforced per tool (`viewer` is
read-only; `member` and `admin` may write). Put TLS in front of it.
## CLI Reference
```
npx @4da/mcp-server # Start server (stdio)
npx @4da/mcp-server --http # Start server (Streamable HTTP)
npx @4da/mcp-server --setup # Auto-configure your editors
npx @4da/mcp-server --doctor # Verify installation health
npx @4da/mcp-server --version # Print version
```
## Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| `FOURDA_DB_PATH` | Path to 4DA's SQLite database | Auto-detected |
| `FOURDA_OFFLINE` | Disable all network calls | `false` |
| `MCP_AUTH_SECRET` | Shared secret for verifying Bearer tokens on `--http` (HMAC-SHA256). Falls back to `JWT_SECRET`. Unset means no token is accepted. | Unset |
| `MCP_AUTH_REQUIRED` | Require auth on a **loopback** `--http` bind. Always required on a non-loopback bind. | `false` |
| `MCP_ALLOWED_HOSTS` | Extra comma-separated hostnames accepted in `Host`/`Origin` (needed when binding to `0.0.0.0`). | localhost only |
## FAQ
**Does this send my code anywhere?**
No. The server sends package names and versions to public APIs ([OSV.dev](https://osv.dev), npm registry, crates.io, PyPI, Go proxy) and generic tech keywords to [HN Algolia](https://hn.algolia.com/api). The same public data visible in your `package.json`. No source code, no file paths, no personal data. Set `FOURDA_OFFLINE=true` to disable all network calls. (The sole exception is opt-in OpenAI embeddings — see the network note above.)
**Do I need the 4DA desktop app?**
No. 9 tools work standalone: vulnerability scanning, dependency health, upgrade planning, ecosystem news, pre-task briefings, project context, decision memory, alignment checking, and agent memory. The desktop app adds a scored content feed from 20+ sources, graded against your actual stack.
**Which AI tools does this work with?**
Any tool that supports [MCP](https://modelcontextprotocol.io): Claude Code, Claude Desktop, Cursor, Windsurf, VS Code (Copilot), and any custom MCP client.
## Build from Source
```bash
git clone https://github.com/4DA-Systems/4DA.git
cd 4DA/mcp-4da-server
pnpm install
pnpm build
pnpm test # 71 contract tests
```
## License
Apache License 2.0 (`Apache-2.0`). See [LICENSE](LICENSE).
---
Built by [4DA](https://4da.ai)
TDQS
Scored across 9 tools
Some tools are clearly distinct (vulnerability_scan vs dependency_health vs upgrade_planner), but get_context, what_should_i_know, and agent_memory all deal with context/memory and could cause misselection. check_decision_alignment overlaps with decision_memory's 'check' functionality.
Tool names follow a consistent snake_case pattern, mixing noun_verb and verb_noun forms (vulnerability_scan, dependency_health, upgrade_planner) with a few verb-first names (get_context, check_decision_alignment). The style is consistent, but verb placement varies slightly.
9 tools is appropriate for a developer-assistant server covering security, dependency, and memory features. Each tool seems purposeful and the count is within the ideal 3-15 range.
The security/dependency workflow is well covered (scan, health, plan), and memory tools cover both recording and recalling. Missing actions like clearing memory or comparing dependency versions are minor gaps that agents could work around.