📇 🏠 - Static server providing persistent tool-specific context and rules to AI models
MCP Context Provider
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
> **Status:** beta — feature-complete, API stabilizing. See CHANGELOG.md for the latest release.
https://github.com/user-attachments/assets/d9c6c325-00f1-44d9-a805-b1d6588c0acf
*Persistent context and learned instincts for Claude Desktop and Claude Code — surviving across sessions.*
A TypeScript MCP server that gives Claude persistent **Contexts** (static tool rules) and **Instincts** (learned, confidence-scored rules distilled from sessions). No more re-establishing context in every new chat.
Architecture
Two core concepts:
| Concept | Description | Size | Lifetime |
|---------|-------------|------|----------|
| **Context** | Static tool rules, syntax preferences, auto-corrections | 200–1000 tokens | Permanent, manually authored |
| **Instinct** | Learned rule extracted from sessions, confidence-scored | 20–80 tokens | Human-approved, evolves over time |
Four subsystems:
- **Engine** — loads, matches, and merges contexts + instincts into injection payloads
- **MCP Server** (src/server/index.ts) — stdio + HTTP transport, 10 MCP tools
- **CLI** (mcp-cp) — approval registry for instinct lifecycle management
- **Memory Bridge** — optional sync of instincts to mcp-memory-service
Quick Start
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):
Claude Code (global)
Add to ~/.mcp.json:
> **Important:** Use absolute paths for both args and env values. Claude Code does not support the cwd field in MCP server configs — relative paths will resolve from the wrong directory and the server will fail to connect.
Claude Code Plugin (Marketplace)
Install directly from the marketplace:
This auto-configures the MCP server with correct paths — no manual .mcp.json editing needed.
/instill Skill (Claude Code)
Install the skill globally (stays current with git pull):
Then use /instill at the end of productive sessions to distill learned patterns into instinct candidates.
Auto-Trigger Hook (Optional)
The instill-trigger hook automatically detects mistakes during a session and nudges Claude to suggest /instill when a threshold is reached. It monitors:
- **User corrections** (UserPromptSubmit) — "no not that", "that's wrong", "still broken", etc.
- **Tool failures** (PostToolUse) — non-zero exit codes, tracebacks, permission errors
Install the hook:
Register in ~/.claude/settings.json under both UserPromptSubmit and PostToolUse:
**Scoring:** Corrections weighted 1.5x, tool failures 0.5x. Combined threshold: 3.0. Max 1 nudge per session. All tunable via CONFIG object in the hook file.
MCP Tools
| Tool | Description |
|------|-------------|
| get_tool_context | Get complete context for a tool category |
| get_syntax_rules | Get syntax-specific rules for a tool |
| list_available_contexts | List all loaded contexts |
| apply_auto_corrections | Apply correction patterns to text |
| build_injection | Combined context + instinct injection payload |
| list_instincts | List all instincts with confidence scores, plus the resolved store path |
Environment Variables
| Variable | Default | Description |
|----------|---------|-------------|
| CONTEXTS_PATH | packaged contexts/ | Path to *_context.json files |
| INSTINCTS_PATH | ~/.local/share/mcp-context-provider/instincts | Directory holding learned.instincts.yaml — see Store Location |
| MEMORY_BRIDGE_URL | — | Memory service base URL (enables bridge) |
| MEMORY_BRIDGE_API_KEY | — | API key for memory service |
| MCP_SERVER_PORT | 3100 | HTTP server port (only with --http) |