Logo van MCP Context Provider

MCP Context Provider

Community
doobidoo

A static MCP server that provides AI models with persistent tool context, preventing context loss between chats.

Uitgeverdoobidoo
RepositoryMCP-Context-Provider
TaalTypeScript
Forks
8
Sterren
30
Beschikbare tools
0
Transporttypestdio
Categorieën
LicentieApache-2.0
Links
  • Koppel tools aan AI-workflows

    MCP Context Provider biedt MCP-functionaliteit die compatibele AI-clients en agenten kunnen gebruiken.

  • Beschikbare tools: 0

    Bekijk hieronder de aanroepbare acties, inclusief namen en beschrijvingen als de server die beschikbaar stelt.

  • Configuratie om direct te kopiëren

    Gebruik de installatievoorbeelden om deze server in je favoriete MCP-client te configureren.

  • Belangstelling voor het opensourceproject

    Statistieken van de gekoppelde repository (sterren: 30, forks: 8).

MCP Context Provider

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:

ConceptDescriptionSizeLifetime
ContextStatic tool rules, syntax preferences, auto-corrections200–1000 tokensPermanent, manually authored
InstinctLearned rule extracted from sessions, confidence-scored20–80 tokensHuman-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

bash
git clone https://codeberg.org/doobidoo/MCP-Context-Provider.git
cd MCP-Context-Provider
npm install
npm run build

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

json
{
  "mcpServers": {
    "context-provider": {
      "command": "node",
      "args": ["/path/to/mcp-context-provider/dist/server/index.js"],
      "env": {
        "CONTEXTS_PATH": "/path/to/mcp-context-provider/contexts",
        "INSTINCTS_PATH": "/path/to/mcp-context-provider/instincts"
      }
    }
  }
}

Claude Code (global)

Add to ~/.mcp.json:

json
{
  "mcpServers": {
    "context-provider": {
      "command": "node",
      "args": ["/path/to/mcp-context-provider/dist/server/index.js"],
      "env": {
        "CONTEXTS_PATH": "/path/to/mcp-context-provider/contexts",
        "INSTINCTS_PATH": "/path/to/mcp-context-provider/instincts"
      }
    }
  }
}

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:

bash
/plugin marketplace add codeberg/doobidoo/MCP-Context-Provider
/plugin install context-provider

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):

bash
mkdir -p ~/.claude/skills/instill
ln -s /path/to/mcp-context-provider/.claude/skills/instill.md ~/.claude/skills/instill/SKILL.md

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:

bash
cp hooks/instill-trigger.js ~/.claude/hooks/core/instill-trigger.js

Register in ~/.claude/settings.json under both UserPromptSubmit and PostToolUse:

json
{
  "type": "command",
  "command": "node --no-warnings \"~/.claude/hooks/core/instill-trigger.js\"",
  "timeout": 3
}

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

ToolDescription
get_tool_contextGet complete context for a tool category
get_syntax_rulesGet syntax-specific rules for a tool
list_available_contextsList all loaded contexts
apply_auto_correctionsApply correction patterns to text
build_injectionCombined context + instinct injection payload
list_instinctsList all instincts with confidence scores, plus the resolved store path

Environment Variables

VariableDefaultDescription
CONTEXTS_PATHpackaged contexts/Path to *_context.json files
INSTINCTS_PATH~/.local/share/mcp-context-provider/instinctsDirectory 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_PORT3100HTTP server port (only with --http)

Store Location

The instincts store never depends on the directory the MCP host happened to launch the server from. It resolves in this order:

  1. INSTINCTS_PATH — explicit override, always wins
  2. ./instincts — only when the working directory is an mcp-context-provider checkout (the development case)
  3. $XDG_DATA_HOME/mcp-context-provider/instincts — when XDG_DATA_HOME is set
  4. ~/.local/share/mcp-context-provider/instincts — the default

Contexts resolve the same way, except the fallback is the contexts/ directory shipped with the package: contexts are authored and versioned with the code, instincts are learned user data.

To see which store is active:

bash
mcp-cp path                     # prints the resolved directory
node dist/server/index.js       # logs both paths to stderr at startup

The resolved path is also part of the list_instincts response (store.path, store.resolved_from) and of the /health payload in HTTP mode.

If the resolved store sits inside a git working tree that is not this repository's checkout, the server warns at startup — that is the signal it picked up a working directory by accident and that learned instincts are about to be committed somewhere they do not belong.

Merging a store from elsewhere:

bash
mcp-cp import /path/to/learned.instincts.yaml --dry-run   # preview
mcp-cp import /path/to/learned.instincts.yaml             # merge

The merge always targets the canonical learned.instincts.yaml.

Existing ids are never overwritten — a merge only adds. Legacy file shapes (top-level array, or instincts: as a list) are normalized on read.

Context Files

Contexts are JSON files in contexts/*_context.json. Each file matches one or more tools via glob patterns and injects static rules.

json
{
  "tool_category": "git",
  "description": "Git workflow rules",
  "auto_convert": false,
  "metadata": {
    "version": "1.0.0",
    "applies_to_tools": ["git:*", "Bash"],
    "priority": "high"
  },
  "syntax_rules": { ... },
  "auto_corrections": {
    "fix-1": { "pattern": "...", "replacement": "..." }
  }
}

Add a new context by dropping a *_context.json file in contexts/ and restarting the server.

Instincts

Instincts live in exactly one file, learned.instincts.yaml, inside the resolved store (see Store Location). They are distilled from sessions via /instill and require human approval.

Any other *.instincts.yaml in that directory is not read. It is reported by name at startup and by mcp-cp list, together with the mcp-cp import command that merges it — so a second file can never drift into the store unnoticed, and no instinct is ever loaded from a file you did not intend.

yaml
version: "1.0"

instincts:
  my-rule:
    id: my-rule
    rule: "Compact, actionable rule (20–80 tokens)."
    domain: git
    tags: [git, workflow]
    trigger_patterns:
      - "git commit"
    confidence: 0.75
    min_confidence: 0.5
    approved_by: human
    active: true
    created_at: "2026-03-10T00:00:00Z"
    outcome_log: []

Manage instincts with the CLI:

bash
mcp-cp list
mcp-cp show <id>
mcp-cp approve <id>
mcp-cp reject <id>
mcp-cp tune <id> --confidence 0.8
mcp-cp outcome <id> + "worked well"
mcp-cp path
mcp-cp import <file> [--dry-run]

Development

bash
npm run build     # Compile TypeScript
npm run dev       # Watch mode
npm run lint      # Type-check only
npm test          # Run tests (vitest)
npm start         # stdio transport
npm run start:http  # HTTP transport on port 3100

FAQ

Can I use /instill in Claude Desktop?

No. /instill is a Claude Code skill (.claude/skills/instill.md) and only works in the Claude Code CLI. Claude Desktop does not have a skill system.

However, you can achieve the same result in Claude Desktop:

  1. MCP tools work in both - The list_instincts and build_injection tools are available in Claude Desktop via the MCP server.
  2. For the instill workflow, create a Claude Desktop Project and paste the instill instructions as Custom Instructions. Claude Desktop can then use desktop-commander or similar MCP servers to write YAML files.

The reason /instill is not exposed as an MCP tool: it is an interactive, multi-step workflow (analyze conversation, present candidates, await user decision, write YAML). MCP tools return a single response and cannot drive multi-turn interactions.

Do learned.instincts.yaml files contain sensitive data?

Potentially yes. Instincts distilled from work sessions may contain internal hostnames, customer names, infrastructure details, or operational procedures.

This is why the default store is a user-level directory outside any repository (~/.local/share/mcp-context-provider/instincts) and why the server warns when the resolved store sits inside an unrelated git working tree. If you do point INSTINCTS_PATH at a checkout, add instincts/learned.instincts.yaml to that repository's .gitignore and review its contents before pushing.

What is the difference between Contexts and Instincts?

ContextsInstincts
FormatJSON (*_context.json)YAML (*.instincts.yaml)
SourceManually authoredDistilled from sessions via /instill
Size200-1000 tokens20-80 tokens
MatchingTool-pattern globsRegex trigger patterns
LifecycleStatic, versionedConfidence-scored, evolves over time
ApprovalNone neededRequires approved_by: human

Changelog

See CHANGELOG.md.

License

Apache-2.0 — see LICENSE.

Installatie

TypingMind
Vereisten:

Node.js 18+

{
  "mcpServers": {
    "doobidoo-mcp-context-provider": {
      "command": "",
      "args": []
    }
  }
}

Gebruik MCP Context Provider MCP met meerdere AI-modellen

TypingMind koppelt MCP-tools aan de werkruimte. Zodra MCP Context Provider is verbonden, kun je de verbinding dus met verschillende AI-modellen in TypingMind gebruiken, zonder die voor elk model apart in te stellen. Deze MCP-integratie draait lokaal via de TypingMind MCP-connector op je apparaat.

Installatiehandleiding voor de lokale connector

Gebruik dit als de MCP-server toegang nodig heeft tot lokale bestanden, apps of privébronnen op je computer.

1

Open de MCP-instellingen

Ga in TypingMind naar Instellingen, Geavanceerde instellingen en vervolgens Model Context Protocol. Kies daar Connector instellen.

  1. Open TypingMind in je browser.
  2. Klik op het pictogram Instellingen.
  3. Ga naar Geavanceerde instellingen.
  4. Open het gedeelte Model Context Protocol.
  5. Klik op Connector instellen en kies Dit apparaat.
Instelscherm voor de TypingMind MCP-connector met Dit apparaat geselecteerd
2

Voer de connectoropdracht uit

Kies Dit apparaat, kopieer de opdracht uit TypingMind en voer deze uit in Terminal. Laat het proces draaien zolang je MCP gebruikt.

  1. Kopieer de installatieopdracht die TypingMind toont.
  2. Open Terminal op macOS of Windows Terminal op Windows.
  3. Plak de opdracht en voer deze uit.
  4. Keur de pakketinstallatie goed als Terminal vraagt of je wilt doorgaan.
  5. Laat het proces in het Terminal-venster draaien zolang je MCP-tools gebruikt.
3

Voeg MCP Context Provider toe als server

Klik op Servers bewerken zodra de connectorstatus Gereed is en plak de MCP-serverconfiguratie.

  1. Wacht tot de connectorstatus op ‘Gereed’ staat.
  2. Klik op Servers bewerken.
  3. Plak de MCP-serverconfiguratie van MCP Context Provider.
  4. Sla de serverlijst op.
  5. Vernieuw de pagina als je wilt controleren of de connectorstatus nog op ‘Gereed’ staat.
MCP-instellingen van TypingMind met een actieve server en de knop Servers bewerken
{
  "mcpServers": {
    "doobidoo-mcp-context-provider": {
      "command": "npx",
      "args": [
        "-y",
        "MCP-Context-Provider"
      ]
    }
  }
}
4

Gebruik de verbinding met verschillende modellen

Sla de serverlijst op, open Plug-ins en schakel de MCP-tools van MCP Context Provider in. Selecteer vervolgens een ondersteund AI-model in TypingMind en gebruik de tools in de chat of wijs ze toe aan een AI-agent.

  1. Open de pagina Plug-ins in TypingMind.
  2. Schakel de MCP-tools van MCP Context Provider in.
  3. Start een chat en kies het AI-model dat je wilt gebruiken.
  4. Gebruik de MCP-tools in een chat of wijs ze toe aan een AI-agent.
  5. Schakel wanneer nodig over naar een ander AI-model zonder opnieuw verbinding te maken met MCP.
TypingMind-chat met ingeschakelde MCP-tools en een geselecteerd AI-model
Kun je MCP Context Provider gebruiken om me hiermee te helpen?
MCP Context Provider
Zeker. Ik heb het gelezen.
Dit vond ik met MCP Context Provider.

Veelgestelde vragen

Waarvoor wordt de MCP-server MCP Context Provider gebruikt?

MCP Context Provider is een MCP-server waarmee compatibele AI-clients toegang krijgen tot externe tools en context. In TypingMind hoef je deze MCP-server maar één keer toe te voegen om de tools beschikbaar te maken in je AI-werkruimte.

Kan ik MCP Context Provider MCP met meerdere AI-modellen in TypingMind gebruiken?

Ja. TypingMind verbindt MCP-tools op werkruimteniveau. Daardoor kun je MCP Context Provider gebruiken met verschillende AI-modellen, zoals Claude, ChatGPT, Gemini of andere modellen die je in TypingMind hebt ingesteld, zonder de MCP-server voor elk model afzonderlijk in te stellen.

Waarom MCP Context Provider MCP gebruiken met TypingMind?

TypingMind is een van de beste interfaces voor chats met LLM's, omdat het meerdere AI-modellen, prompts, plug-ins, AI-agenten, API-sleutels en MCP-tools samenbrengt in één werkruimte. Als MCP Context Provider verbonden is, kun je de MCP-tools ervan gebruiken met je favoriete modellen en je chatworkflow overzichtelijk houden in TypingMind.

Hoe verbind ik MCP Context Provider MCP met TypingMind?

MCP Context Provider werkt via de lokale MCP-connector van TypingMind. Dit is de beste optie als de MCP-server toegang nodig heeft tot lokale bestanden, desktopapps, opdrachtregeltools of privébronnen op je computer.

Welke tools biedt MCP Context Provider MCP in TypingMind?

MCP Context Provider biedt MCP-functies die je kunt inschakelen via de pagina Plug-ins in TypingMind. Je kunt ze gebruiken in chats of toewijzen aan AI-agenten.

Moet ik mijn API-sleutels delen met TypingMind om MCP Context Provider MCP te gebruiken?

Nee. TypingMind werkt in de eerste plaats lokaal en laat je de controle houden over je modelaanbieders, API-sleutels, prompts en MCP-configuratie. Als MCP Context Provider authenticatie vereist, voeg je bij het maken van de verbinding de vereiste headers, OAuth-instellingen of lokale configuratie voor die MCP-server toe.

Gerelateerde MCP-servers

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇