Skip to main content
Glama
portel-dev

NCP - Natural Context Provider

by portel-dev
README.md
[![npm version](https://img.shields.io/npm/v/%40portel%2Fncp.svg)](https://www.npmjs.com/package/@portel/ncp)
[![npm downloads](https://img.shields.io/npm/dt/@portel/ncp?label=downloads)](https://www.npmjs.com/package/@portel/ncp)
[![GitHub release downloads](https://img.shields.io/github/downloads/portel-dev/ncp/total?label=.dxt%20downloads)](https://github.com/portel-dev/ncp/releases)
[![Latest release](https://img.shields.io/github/downloads/portel-dev/ncp/latest/total?label=latest%20.dxt)](https://github.com/portel-dev/ncp/releases/latest)
[![License: Elastic-2.0](https://img.shields.io/badge/License-Elastic--2.0-blue.svg)](https://www.elastic.co/licensing/elastic-license)
[![MCP Compatible](https://img.shields.io/badge/MCP-Compatible-blue.svg)](https://modelcontextprotocol.io/)

<!-- mcp-name: io.github.portel-dev/ncp -->

<div align="center">

<img src="./assets/ncp.svg" alt="NCP Logo" width="200" height="200">

# NCP - Natural Context Provider

> **1 MCP to rule them all**

</div>

Your MCPs, [supercharged](#-supercharged-features). Discover tools, execute with code mode, run on schedule, find skills, and load Photons through common MCP clients. On-demand discovery keeps the initial tool surface focused.

**Related Portel project:** [Photon](https://photon.portel.dev/) turns TypeScript methods into reliable agent-facing capabilities: MCP tools, embedded app UIs, CLI commands, web routes, schedules, webhooks, retries, and Beam interfaces. NCP helps agents discover and operate tools; Photon helps developers build the tools and apps agents can trust.

## ๐Ÿ’ **What is NCP?**

Instead of your AI juggling 50+ tools scattered across different MCPs, NCP gives it a single, unified interface with **code mode execution, scheduling, skills discovery, and custom Photons**.

Most hosts see NCP's small gateway surface (`find`, `run`, and, when enabled, `code`). Hosts that support MCP Apps can also receive selected app callback tools so embedded interfaces keep working. NCP adds app tools selectively; it omits conflicting app groups rather than renaming callbacks that an app may call by name.

- **`find`** - Search for any tool, skill, or Photon: "I need to read a file" โ†’ finds the right tool automatically
- **`code`** - Execute TypeScript directly: `await github.create_issue({...})` (code mode, enabled by default)
- **`run`** - Execute tools individually (when code mode is disabled)

Behind the scenes, NCP manages all 50+ tools + skills + Photons: routing requests, discovering the right capability, executing code, scheduling tasks, managing health, and caching responses.

The host determines which optional features it can use. NCP advertises MCP Apps, Skills, and Tasks capabilities, while clients that do not support an extension continue with the core tools and existing request flows.

![NCP Transformation Flow](docs/images/ncp-transformation-flow.png)

**Why this matters:**
- Your AI stops analyzing "which tool do I use?" and starts doing actual work
- **Code mode** lets AI write multi-step TypeScript workflows combining tools, skills, and scheduling
- **Skills** provide domain expertise: canvas design, PDF manipulation, document generation, more
- **Photons** enable custom TypeScript MCPs without npm publishing
- **On-demand discovery** keeps the initial tool surface focused; actual context use depends on the host, enabled NCP tools, and connected servers
- **Your AI becomes focused.** Not desperate.

๐Ÿš€ **NEW:** Project-level configuration - each project can define its own MCPs automatically

> **What's MCP?** The [Model Context Protocol](https://modelcontextprotocol.io) by Anthropic lets AI assistants connect to external tools and data sources. Think of MCPs as "plugins" that give your AI superpowers like file access, web search, databases, and more.

---

## ๐Ÿ“‘ **Quick Navigation**

- [The Problem](#-the-mcp-paradox-from-assistant-to-desperate) - Why too many tools break your AI
- [The Solution](#-the-before--after-reality) - How NCP transforms your experience
- [Getting Started](#-prerequisites) - Installation & quick start
- [Try It Out](#-test-drive-see-the-difference-yourself) - See the CLI in action
- [Supercharged Features](#-supercharged-features) - How NCP empowers your MCPs
- [Setup by Client](#๏ธ-configuration-for-different-ai-clients) - Claude Desktop, Cursor, VS Code, etc.
- [Popular MCPs](#-popular-mcps-that-work-great-with-ncp) - Community favorites to add
- [Advanced Features](#-advanced-features) - Project config, scheduling, remote MCPs
- [Troubleshooting](#-troubleshooting) - Common issues & solutions
- [How It Works](#-deep-dive-how-it-works) - Technical deep dive
- [Contributing](#-contributing) - Help us improve NCP

---

## ๐Ÿ˜ค **The MCP Paradox: From Assistant to Desperate**

You gave your AI assistant 50 tools to be more capable. Instead, you got desperation:

- **Paralyzed by choice** ("Should I use `read_file` or `get_file_content`?")
- **Exhausted before starting** ("I've spent my context limit analyzing which tool to use")
- **Costs explode** (50+ tool schemas burn tokens before any real work happens)
- **Asks instead of acts** (used to be decisive, now constantly asks for clarification)

---

## ๐Ÿงธ **Why Too Many Tools Break the System**

Think about it like this:

**A child with one toy** โ†’ Treasures it, masters it, creates endless games with it
**A child with 50 toys** โ†’ Can't hold them all, gets overwhelmed, stops playing entirely

**Your AI is that child.** MCPs are the toys. More isn't always better.

The most creative people thrive with **constraints**, not infinite options. A poet given "write about anything" faces writer's block. Given "write a haiku about rain"? Instant inspiration.

**Your AI is the same.** Give it one perfect tool โ†’ Instant action. Give it 50 tools โ†’ Cognitive overload. NCP provides just-in-time tool discovery so your AI gets exactly what it needs, when it needs it.

---

## ๐Ÿ“Š **The Before & After Reality**

### **Before NCP: Desperate Assistant** ๐Ÿ˜ตโ€๐Ÿ’ซ

When your AI assistant manages 50 tools directly:

```
๐Ÿค– AI Assistant Context:
โ”œโ”€โ”€ Filesystem MCP (12 tools)
โ”œโ”€โ”€ Database MCP (8 tools)
โ”œโ”€โ”€ Web Search MCP (6 tools)
โ”œโ”€โ”€ Email MCP (15 tools)
โ”œโ”€โ”€ Shell MCP (10 tools)
โ”œโ”€โ”€ GitHub MCP (20 tools)
โ””โ”€โ”€ Slack MCP (9 tools)

๐Ÿ’€ Total: 80 tool schemas compete for attention before useful work begins
```

**What happens:**
- AI burns 50%+ of context just understanding what tools exist
- Spends 5-8 seconds analyzing which tool to use
- Often picks wrong tool due to schema confusion
- Hits context limits mid-conversation

### **After NCP: Executive Assistant** โœจ

With NCP as Chief of Staff:

```
๐Ÿค– AI Assistant Context:
โ””โ”€โ”€ NCP gateway tools โ†’ discover and run the tools needed for this request

๐ŸŽฏ Behind the scenes: NCP manages all 80 tools
๐Ÿ“ˆ Tool discovery happens on demand
๐ŸŽช AI behavior: Confident, focused, decisive
```

NCP reduces the need to load every downstream tool schema into the host up front. The amount of context saved and any effect on response time vary with the host, server catalog, and enabled features.

---

## ๐Ÿ“‹ **Prerequisites**

- **Node.js 22+** (Node.js 24 recommended; CI uses 24) ([Download here](https://nodejs.org/))
- **npm** (included with Node.js) or **npx** for running packages
- **Command line access** (Terminal on Mac/Linux, Command Prompt/PowerShell on Windows)

## ๐Ÿš€ **Installation**

Choose your MCP client for setup instructions:

| Client | Description | Setup Guide |
|--------|-------------|-------------|
| **Claude Desktop** | Anthropic's official desktop app. **Best for NCP** - one-click .dxt install with auto-sync | **[โ†’ Full Guide](docs/clients/claude-desktop.md)** |
| **Claude Code** | Terminal-first AI workflow. Works out of the box! | Built-in support |
| **VS Code** | GitHub Copilot with Agent Mode. Use NCP for semantic tool discovery | **[โ†’ Setup](docs/clients/vscode.md)** |
| **Cursor** | AI-first code editor with Composer. Popular VS Code alternative | **[โ†’ Setup](docs/clients/cursor.md)** |
| **Windsurf** | Codeium's AI-native IDE with Cascade. Built on VS Code | **[โ†’ Setup](docs/clients/windsurf.md)** |
| **Cline** | VS Code extension for AI-assisted development with MCP support | **[โ†’ Setup](docs/clients/cline.md)** |
| **Continue** | VS Code AI assistant with Agent Mode and local LLM support | **[โ†’ Setup](docs/clients/continue.md)** |
| **Want more clients?** | See the full list of MCP-compatible clients and tools | [Official MCP Clients](https://github.com/modelcontextprotocol/servers#clients) โ€ข [Awesome MCP](https://github.com/punkpeye/awesome-mcp) |
| **Other Clients** | Any MCP-compatible client via npm | [Quick Start โ†“](#quick-start-npm) |

---

### Quick Start (npm)

For advanced users or MCP clients not listed above:

**Step 1: Install NCP**
```bash
npm install -g @portel/ncp
```

**Step 2: Import existing MCPs (optional)**
```bash
ncp config import  # Paste your config JSON when prompted
```

**Step 3: Configure your MCP client**

Add to your client's MCP configuration:
```json
{
  "mcpServers": {
    "ncp": {
      "command": "ncp"
    }
  }
}
```

**โœ… Done!** Your AI can discover and run tools through NCP. Hosts with MCP Apps support may also receive selected app callback tools.

![NCP List Overview](docs/images/ncp-list.png)

---

## ๐Ÿงช **Test Drive: See the Difference Yourself**

Want to experience what your AI experiences? NCP has a human-friendly CLI:

### **๐Ÿ” Smart Discovery**
```bash
# Ask like your AI would ask:
ncp find "I need to read a file"
ncp find "help me send an email"
ncp find "search for something online"
```

![NCP Find Command](docs/images/ncp-find.png)

**Notice:** NCP understands intent, not just keywords. Just like your AI needs.

### **๐Ÿ“‹ Ecosystem Overview**
```bash
# See your complete MCP ecosystem:
ncp list --depth 2

# Get help anytime:
ncp --help
```

![NCP Help Command](docs/images/ncp-help.png)

### **โšก Direct Testing**
```bash
# Test any tool safely:
ncp run filesystem read_file --path "/tmp/test.txt"
```

**Why this matters:** You can debug and test tools directly, just like your AI would use them.

### **โœ… Verify Everything Works**

```bash
# 1. Check NCP is installed correctly
ncp --version

# 2. Confirm your MCPs are imported
ncp list

# 3. Test tool discovery
ncp find "file"

# 4. Test a simple tool (if you have filesystem MCP)
ncp run filesystem read_file --path "/tmp/test.txt" --dry-run
```

**โœ… Success indicators:**
- NCP shows version number
- `ncp list` shows your imported MCPs
- `ncp find` returns relevant tools
- Your AI client shows NCP's gateway tools; an Apps-capable host may also show selected app callback tools

---

## ๐Ÿ’ช **From Tools to Automation: The Real Power**

You've seen `find` (discover tools) and `code` (execute TypeScript). Individually, they're useful. **Together with scheduling, they become an automation powerhouse.**

### A Real Example: The MCP Conference Scraper

We wanted to stay on top of MCP-related conferences and workshops for an upcoming release. Instead of manually checking websites daily, we asked Claude:

> "Set up a daily scraper that finds MCP conferences and saves them to a CSV file"

**What Claude did:**

1. **Used `code` to write the automation:**
   ```typescript
   // Search the web for MCP conferences
   const results = await web.search({
     query: "Model Context Protocol conference 2025"
   });

   // Read each result and extract details
   for (const url of results) {
     const content = await web.read({ url });
     // Extract title, deadline, description...
     // Save to ~/.ncp/mcp-conferences.csv
   }
   ```

2. **Used `schedule` to automate it:**
   ```bash
   ncp schedule create code:run "every day at 9am" \
     --name "MCP Conference Scraper" \
     --catchup-missed
   ```

**How to set this up yourself:**

First, install the web photon (provides search and read capabilities):
```bash
# Install from the official photons repo
ncp photon add https://raw.githubusercontent.com/portel-dev/photons/main/web.photon.ts
```

Then ask Claude to create the scraper - it will use the web photon automatically.

**What happens now:**
- Every morning at 9am, the scraper runs automatically
- Searches for new MCP events and adds them to the CSV
- If our laptop was closed at 9am, it catches up when we open it
- We wake up to fresh conference data - no manual work

**The insight:** `find` and `code` let AI write automation. `schedule` makes it run forever. That's the powerhouse.

---

## ๐Ÿ’ก **Why NCP Transforms Your AI Experience**

### **๐Ÿง  From Desperation to Delegation**
- **Desperate Assistant:** "I see 50 tools... which should I use... let me think..."
- **Executive Assistant:** "I need file access. Done." *(NCP handles the details)*

### **๐Ÿ’ฐ Focused Tool Discovery**
- NCP lets the host search a larger tool catalog on demand
- The context impact depends on your host and enabled tool surface

### **๐ŸŽฏ Eliminates Choice Paralysis**
- **Desperate:** AI freezes, picks wrong tool, asks for clarification
- **Executive:** NCP's Chief of Staff finds the RIGHT tool instantly

### **๐Ÿš€ Confident Action**
- **Before:** 8-second delays, hesitation, "Which tool should I use?"
- **After:** Instant decisions, immediate execution, zero doubt

**Bottom line:** Your AI goes from desperate assistant to **executive assistant**.

---

## โšก **Supercharged Features**

Here's exactly how NCP empowers your MCPs:

| Feature | What It Does | Why It Matters |
|---------|-------------|----------------|
| **๐Ÿ” Tool Discovery** | Search tools by intent as well as keywords | Find relevant tools without exposing every downstream schema at once |
| **๐Ÿ“ฆ On-Demand Loading** | Discover downstream tools when needed | Keeps the initial tool surface focused; context savings vary by setup |
| **โฐ Automated Scheduling** | Run any tool on cron schedules or natural language times | Background automation without keeping AI sessions open |
| **๐Ÿ”Œ MCP Client Support** | Works with common MCP clients, including Claude Desktop, Claude Code, Cursor, and VS Code | Core gateway behavior is available broadly; extension support depends on the host |
| **๐Ÿ’พ Smart Caching** | Intelligent caching of tool schemas and responses | Eliminates redundant indexing - energy efficient and fast |

**The result:** Your MCPs go from scattered tools to a **unified, intelligent system** that your AI can actually use effectively.

---

## ๐Ÿ› ๏ธ **For Power Users: Manual Setup**

Prefer to build from scratch? Add MCPs manually:

```bash
# Add the most popular MCPs:

# AI reasoning and memory
ncp add sequential-thinking npx @modelcontextprotocol/server-sequential-thinking
ncp add memory npx @modelcontextprotocol/server-memory

# File and development tools
ncp add filesystem npx @modelcontextprotocol/server-filesystem ~/Documents  # Path: directory to access
ncp add github npx @modelcontextprotocol/server-github                       # No path needed

# Search and productivity
ncp add brave-search npx @modelcontextprotocol/server-brave-search           # No path needed
```

![NCP Add Command](docs/images/ncp-add.png)

**๐Ÿ’ก Pro tip:** Browse [Smithery.ai](https://smithery.ai) (2,200+ MCPs) or [mcp.so](https://mcp.so) to discover tools for your specific needs.

---

## ๐ŸŽฏ **Popular MCPs That Work Great with NCP**

### **๐Ÿ”ฅ Most Downloaded**
```bash
# Community favorites (download counts from Smithery.ai):
ncp add sequential-thinking npx @modelcontextprotocol/server-sequential-thinking  # 5,550+ downloads
ncp add memory npx @modelcontextprotocol/server-memory                            # 4,200+ downloads
ncp add brave-search npx @modelcontextprotocol/server-brave-search                # 680+ downloads
```

### **๐Ÿ› ๏ธ Development Essentials**
```bash
# Popular dev tools:
ncp add filesystem npx @modelcontextprotocol/server-filesystem ~/code
ncp add github npx @modelcontextprotocol/server-github
ncp add shell npx @modelcontextprotocol/server-shell
```

### **๐ŸŒ Productivity & Integrations**
```bash
# Enterprise favorites:
ncp add gmail npx @mcptools/gmail-mcp
ncp add slack npx @modelcontextprotocol/server-slack
ncp add google-drive npx @modelcontextprotocol/server-gdrive
ncp add postgres npx @modelcontextprotocol/server-postgres
ncp add puppeteer npx @hisma/server-puppeteer
```


## ๐Ÿค– **Internal MCPs**

NCP includes powerful internal MCPs that extend functionality beyond external tool orchestration:

### **Scheduler MCP** - Automate Any Tool
Schedule any MCP tool to run automatically using cron or natural language schedules.

```bash
# Schedule a daily backup check
ncp run schedule:create --params '{
  "name": "Daily Backup",
  "schedule": "every day at 2am",
  "tool": "filesystem:list_directory",
  "parameters": {"path": "/backups"}
}'
```

**Features:**
- โœ… Natural language schedules ("every day at 9am", "every monday")
- โœ… Standard cron expressions for advanced control
- โœ… Automatic validation before scheduling
- โœ… Execution history and monitoring
- โœ… Works even when NCP is not running (system cron integration)

**[โ†’ Full Scheduler Guide](docs/SCHEDULER_USER_GUIDE.md)**

### **MCP Management MCP** - Install MCPs from AI
Install and configure MCPs dynamically through natural language.

```bash
# AI can discover and install MCPs for you
ncp find "install mcp"
# Shows: mcp:add, mcp:remove, mcp:list
```

**Features:**
- โœ… Search and discover MCPs from registries
- โœ… Install MCPs without manual configuration
- โœ… Update and remove MCPs programmatically
- โœ… AI can self-extend with new capabilities

### **Skills Management MCP** - Extend Claude with Plugins

Manage Anthropic Agent Skills - modular extensions that add specialized knowledge and tools to Claude.

```typescript
// Discover skills using vector search
const results = await skills.find({ query: "canvas design" });

// Install a skill
await skills.add({ skill_name: "canvas-design" });

// List installed skills
const installed = await skills.list();

// Read skill resources
const template = await skills.read_resource({
  skill_name: "canvas-design",
  file_path: "resources/templates.md"
});
```

**Features:**
- โœ… Vector-powered semantic search for skills
- โœ… One-command install from official marketplace
- โœ… Progressive disclosure (metadata โ†’ full content โ†’ resources)
- โœ… Official Anthropic marketplace integration
- โœ… Custom marketplace support
- โœ… Auto-loading of installed skills

**[โ†’ Full Skills Guide](./SKILLS.md)**

### **Analytics MCP** - Visualize Usage & Performance
View usage statistics, token savings, and performance metrics directly in your chat.

```bash
# View usage overview with ASCII charts
ncp run analytics:overview --params '{"period": 7}'
```

**Features:**
- โœ… Usage trends and most used tools
- โœ… Token savings analysis (Code-Mode efficiency)
- โœ… Performance metrics (response times, error rates)
- โœ… ASCII-formatted charts for AI consumption

**Configuration:**
Internal MCPs are disabled by default. Enable in your profile settings:

```json
{
  "settings": {
    "enable_schedule_mcp": true,
    "enable_mcp_management": true,
    "enable_skills": true,
    "enable_analytics_mcp": true
  }
}
```

---

## ๐Ÿ”ง **Advanced Features**

### **Smart Health Monitoring**
NCP automatically detects broken MCPs and routes around them:

```bash
ncp list --depth 1    # See health status
ncp config validate   # Check configuration health
```

**๐ŸŽฏ Result:** Your AI never gets stuck on broken tools.

### **Multi-Profile Organization**
Organize MCPs by project or environment:

```bash
# Development setup
ncp add --profile dev filesystem npx @modelcontextprotocol/server-filesystem ~/dev

# Production setup
ncp add --profile prod database npx production-db-server

# Use specific profile
ncp --profile dev find "file tools"
```

### **๐Ÿš€ Project-Level Configuration**
**New:** Configure MCPs per project with automatic detection - perfect for teams and Cloud IDEs:

```bash
# In any project directory, create local MCP configuration:
mkdir .ncp
ncp add filesystem npx @modelcontextprotocol/server-filesystem ./
ncp add github npx @modelcontextprotocol/server-github

# NCP automatically detects and uses project-local configuration
ncp find "save file"  # Uses only project MCPs
```

**How it works:**
- ๐Ÿ“ **Local `.ncp` directory exists** โ†’ Uses project configuration
- ๐Ÿ  **No local `.ncp` directory** โ†’ Falls back to global `~/.ncp`
- ๐ŸŽฏ **Zero profile management needed** โ†’ Everything goes to default `all.json`

**Perfect for:**
- ๐Ÿค– **Claude Code projects** (project-specific MCP tooling)
- ๐Ÿ‘ฅ **Team consistency** (ship `.ncp` folder with your repo)
- ๐Ÿ”ง **Project-specific tooling** (each project defines its own MCPs)
- ๐Ÿ“ฆ **Environment isolation** (no global MCP conflicts)

```bash
# Example project structures:
frontend-app/
  .ncp/profiles/all.json   # โ†’ playwright, lighthouse, browser-context
  src/

api-backend/
  .ncp/profiles/all.json   # โ†’ postgres, redis, docker, kubernetes
  server/
```

### **Remote MCP Transports and Hibernation Support**

NCP supports both **stdio** (local) and **HTTP/SSE** (remote) MCP servers:

**Stdio Transport** (Traditional):
```bash
# Local MCP servers running as processes
ncp add filesystem npx @modelcontextprotocol/server-filesystem ~/Documents
```

**Streamable HTTP** (Remote):
```json
{
  "mcpServers": {
    "remote-mcp": {
      "url": "https://mcp.example.com/api",
      "transport": "streamableHttp",
      "auth": {
        "type": "bearer",
        "token": "your-token-here"
      }
    }
  }
}
```

For a legacy HTTP/SSE endpoint, set `"transport": "sse"`. If an older profile has a URL and no `transport`, NCP continues to use its legacy SSE behavior. New registry imports select Streamable HTTP by default. Protocol-version negotiation is separate from transport selection and does not discover another endpoint automatically.

**OAuth 2.1 with PKCE** (MCP 2025-03-26 spec):
```json
{
  "mcpServers": {
    "oauth-mcp": {
      "url": "https://mcp.example.com/api",
      "auth": {
        "type": "oauth",
        "oauth21": {
          "scopes": ["read", "write"],
          "callbackPort": 9876,
          "clientId": "optional-pre-registered-client-id",
          "clientSecret": "optional-client-secret"
        }
      }
    }
  }
}
```

**OAuth 2.1 Features:**
- โœ… **PKCE (Proof Key for Code Exchange)** - Required by OAuth 2.1 for security
- โœ… **Dynamic Client Registration (RFC 7591)** - Auto-registers if no clientId provided
- โœ… **Token Storage & Auto-Refresh** - Tokens saved to `~/.ncp/auth/` and refreshed automatically
- โœ… **Browser Authorization Flow** - Opens browser for user consent
- โœ… **Headless Fallback** - Manual code entry for servers/CI environments
- โœ… **Protected Resource Discovery (RFC 9728)** - Auto-discovers OAuth endpoints

**First-time setup flow:**
1. NCP opens browser to authorization URL
2. You grant permissions
3. Browser redirects to local callback (`http://localhost:9876`)
4. NCP exchanges code for access token (with PKCE)
5. Token saved and refreshed automatically for future requests

**๐Ÿ”‹ Hibernation-Enabled Servers:**

NCP automatically supports hibernation-enabled MCP servers (like Cloudflare Durable Objects or Metorial):
- **Zero configuration needed** - Hibernation works transparently
- **Automatic wake-up** - Server wakes on demand when NCP makes requests
- **State preservation** - Server state is maintained across hibernation cycles
- **Cost savings** - Only pay when MCPs are actively processing requests

**How it works:**
1. Server hibernates when idle (consumes zero resources)
2. NCP sends a request โ†’ Server wakes instantly
3. Server processes request and responds
4. Server returns to hibernation after idle timeout

**Perfect for:**
- ๐Ÿ’ฐ **Cost optimization** - Only pay for active processing time
- ๐ŸŒ **Cloud-hosted MCPs** - Metorial, Cloudflare Workers, serverless platforms
- โ™ป๏ธ **Resource efficiency** - No idle server costs
- ๐Ÿš€ **Scale to zero** - Servers automatically sleep when not needed

> **Note:** Hibernation is a server-side feature. NCP's remote MCP client works with both traditional and hibernation-enabled servers without special configuration.

### **Modern MCP extensions and result handling**

NCP preserves downstream tool descriptors and native MCP results through discovery and `run`, including structured content, error state, metadata, and text, image, audio, resource, and resource-link blocks. If an integration previously parsed JSON text that encoded an array of result blocks, update it to consume the native MCP result fields.

When a host advertises MCP Apps support, NCP selectively exposes downstream app launch tools and app callbacks, and serves their `ui://` resources. The host controls whether app-only callbacks are available to the model. Tool-name and UI-resource collisions cause the affected app groups to be omitted; their ordinary tools remain available through `find` and `run`.

The Skills extension exposes local and compatible remote skill manifests on demand, including SHA-256 digests for the manifest bytes. The Tasks extension gives compatible modern hosts durable handles for `run` and `code`, with `tasks/get`, `tasks/update`, and `tasks/cancel`. After a restart, unfinished work is reported as interrupted rather than replayed; cancellation is reported only when NCP can confirm the worker stopped. Hosts without Tasks support keep the existing synchronous or multi-round request flow.

Response caches are bounded, and private cached entries are partitioned by server configuration and credential identity. Server cache lifetimes and tool-list change notifications guide refreshes. For transport, SDK, registry, extension, and compatibility details, see the [MCP compatibility notes](docs/development/mcp-compatibility.md).

### **Photon Runtime (CLI vs DXT)**

The TypeScript Photon runtime is enabled by default, but the toggle lives in different places depending on how you run NCP:

- **CLI / npm installs:** Edit `~/.ncp/settings.json` (or run `ncp config`) and set `enablePhotonRuntime: true` or `false`. You can also override adโ€‘hoc with `NCP_ENABLE_PHOTON_RUNTIME=true ncp find "photon"`.
- **DXT / client bundles (Claude Desktop, Cursor, etc.):** These builds **ignore** `~/.ncp/settings.json`. Configure photons by setting the env var inside the client config:

```json
{
  "mcpServers": {
    "ncp": {
      "command": "ncp",
      "env": {
        "NCP_ENABLE_PHOTON_RUNTIME": "true"
      }
    }
  }
}
```

If you disable the photon runtime, internal MCPs continue to work, but `.photon.ts` files are ignored until you re-enable the flag.

### **Import from Anywhere**
```bash
# From clipboard (any JSON config)
ncp config import

# From specific file
ncp config import "~/my-mcp-config.json"

# From Claude Desktop (auto-detected paths)
ncp config import
```

---

## ๐Ÿ›Ÿ **Troubleshooting**

### **Import Issues**
```bash
# Check what was imported
ncp list

# Validate health of imported MCPs
ncp config validate

# See detailed import logs
DEBUG=ncp:* ncp config import
```

### **AI Not Using Tools**
- **Check connection:** `ncp list` (should show your MCPs)
- **Test discovery:** `ncp find "your query"`
- **Validate config:** Ensure your AI client points to `ncp` command

### **Performance Issues**
```bash
# Check MCP health (unhealthy MCPs slow everything down)
ncp list --depth 1

# Clear cache if needed
rm -rf ~/.ncp/cache

# Monitor with debug logs
DEBUG=ncp:* ncp find "test"
```

---

## ๐ŸŒ“ **Why We Built This**

**Like Yin and Yang, everything relies on the balance of things.**

**Compute** gives us precision and certainty.
**AI** gives us creativity and probability.

We believe breakthrough products emerge when you combine these forces in the right ratio.

**How NCP embodies this balance:**

| What NCP Does | AI (Creativity) | Compute (Precision) | The Balance |
|---------------|-----------------|---------------------|-------------|
| **Tool Discovery** | Understands "read a file" semantically | Routes to exact tool deterministically | Natural request โ†’ Precise execution |
| **Orchestration** | Flexible to your intent | Reliable tool execution | Natural flow โ†’ Certain outcomes |
| **Health Monitoring** | Adapts to patterns | Monitors connections, auto-failover | Smart adaptation โ†’ Reliable uptime |

Neither pure AI (too unpredictable) nor pure compute (too rigid).

Your AI stays creative. NCP handles the precision.

---

## ๐Ÿ“š **Deep Dive: How It Works**

A [reproducible gateway benchmark](docs/benchmarks/mcp-gateway.md) measures serialized payload sizes, local latency, workflow completion, and result fidelity. Run `npm run benchmark:mcp`; its byte-based token proxy is labeled separately from actual tokenizer measurements.

Want the technical details? Token analysis, architecture diagrams, and performance benchmarks:

๐Ÿ“– **[Read the Technical Guide โ†’](HOW-IT-WORKS.md)**

Learn about:
- Vector similarity search algorithms
- N-to-1 orchestration architecture
- Real-world token usage comparisons
- Health monitoring and failover systems

---

## ๐Ÿค **Contributing**

Help make NCP even better:

- ๐Ÿ› **Bug reports:** [GitHub Issues](https://github.com/portel-dev/ncp/issues)
- ๐Ÿ’ก **Feature requests:** [GitHub Discussions](https://github.com/portel-dev/ncp/discussions)
- ๐Ÿ”„ **Pull requests:** [Contributing Guide](CONTRIBUTING.md)

---

## ๐Ÿ“„ **License**

Elastic License 2.0 - [Full License](LICENSE)

**TLDR:** Free for all use including commercial. Cannot be offered as a hosted service to third parties.

TDQS

A3.9/5.0

Scored across 2 tools

Disambiguation5/5

find and code have clearly distinct purposes: one for discovering/listing tools, the other for executing TypeScript code. There is no ambiguity about which tool to use for a given task.

Naming Consistency4/5

Both tool names are lowercase single words, so the style is consistent. However, the names are vague and do not follow a descriptive verb_noun convention like search_tools or execute_code.

Tool Count3/5

With only two tools, the server feels thin, but as a meta-tool that can execute arbitrary code, it could be reasonably scoped. Still, two tools is on the low end and likely limits direct usability.

Completeness2/5

The server advertises ncp.do and direct namespace calls, but these are not exposed as actual tools. The only way to invoke external tools is through the code tool, which is a significant gap for a provider that claims to make tool invocation natural. Basic operations like retrieving a specific tool's schema or directly calling a tool are missing.

Maintenance

ActivityMaintained
ResponsivenessUnresponsive