mcp-project-context-server
The server gives LLMs persistent, searchable access to a project's context (docs, ADRs, session notes) via MCP tools.
Semantically search the full project context, ADR decisions, or past session files.
Deterministically find and load the most recent session file.
Load specific .context/ files into context, tagged with path and SHA-512 hash.
Detect and reload changed files previously loaded into active context.
Save session summaries to .context/sessions/YYYY-MM-DD.md.
Re-index the .context/ directory into the configured vector store.
List accessible repositories, optionally filtered by organisation.
Supports multiple embedding providers (Ollama, Voyage, OpenAI, Cohere, Google, Vertex AI), vector stores (ChromaDB, pgvector), repository providers (local, GitHub, GitLab, Gitea), and stdio/HTTP-SSE transports.
Supports multi-tenant repository allowlisting for controlled access.
Integrates with VS Code Copilot to provide access to project context such as documentation and architecture decisions.
Supports JetBrains IDEs through the Continue extension, giving the assistant access to project context.
Uses Ollama as the embedding model provider for semantic search over project documentation.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-project-context-server find documentation about authentication flow"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Project Context Server
📖 About the Server
MCP Project Context Server provides a robust, production-ready Model Context Protocol (MCP) server implementation designed to give Large Language Models (LLMs) persistent, searchable access to your project's contextual information.
Core Capabilities
🔍 Semantic Search Engine: Query your project documentation using natural language
📚 Persistent Knowledge Base: Store and retrieve information from
.context/directory structure🏗️ Modular Architecture: Pluggable embedding providers, vector stores, and repository providers
🎯 ADR Integration: Full support for Architecture Decision Records with lifecycle management
📝 Session Tracking: Record and retrieve session notes for future reference
🔄 Easy Reindexing: Rebuild your knowledge base with a single command
Key Features
✅ Multi-Provider Embedding: Ollama, Voyage AI, OpenAI, Cohere, Google Gemini, and Google Vertex AI
✅ Flexible Vector Storage: ChromaDB (local or HTTP) and pgvector (PostgreSQL)
✅ Multiple Repository Providers: Local filesystem, GitHub, GitLab, and Gitea
✅ Transport Options: stdio (default) and HTTP/SSE for remote deployments
✅ Configuration-Free: Environment variable-based setup, no hardcoded paths
✅ Cross-Platform: Works on Windows, macOS, and Linux
✅ Async-First: All operations use async/await for performance and scalability
✅ Error-Resilient: Graceful error handling with informative messaging
Related MCP server: context-hub-mcp
📋 Table of Contents
Prerequisites
Before installing, ensure you have:
Python 3.11+ installed
Ollama running with an embedding model (e.g.,
nomic-embed-text)At least 2GB RAM available
4.5GB disk space for ChromaDB (minimum)
🚀 Installation
Core Package
pip install mcp-project-context-serverThe core package contains the server, tools, and ChromaDB local integration. It does not bundle any embedding provider SDK. You must install the extra for your chosen provider.
Embedding Provider Extras
Install the extra that matches your chosen embedding provider:
Provider | Extra | Install Command |
Ollama (local, no API key) |
|
|
Voyage AI |
|
|
OpenAI |
|
|
Cohere |
|
|
Google Gemini |
|
|
Google Vertex AI |
|
|
Vector Store Extras
ChromaDB (local and HTTP) is included in the core package. Install the pgvector extra only if you are using PostgreSQL:
pip install "mcp-project-context-server[pgvector]"HTTP/SSE Transport Extra
Required only when running the server over HTTP/SSE (remote deployments, Google Agent Engine, etc.):
pip install "mcp-project-context-server[sse]"Combining Extras
Multiple extras can be combined in a single install:
# Ollama with pgvector
pip install "mcp-project-context-server[ollama,pgvector]"
# OpenAI with SSE transport
pip install "mcp-project-context-server[openai,sse]"
# Cohere with pgvector and SSE
pip install "mcp-project-context-server[cohere,pgvector,sse]"Install Everything
pip install "mcp-project-context-server[all]"From Source
git clone https://github.com/DarkMatterProductions/mcp-project-context-server.git
cd mcp-project-context-server
pip install -e ".[ollama]" # Replace with your chosen provider extra🔌 Embedding Providers
The embedding provider is selected by the EMBED_PROVIDER environment variable. This variable is required — the server will not start without it.
export EMBED_PROVIDER=ollama # Replace with your chosen providerSupported values: ollama, voyage, openai, cohere, google, vertexai
Ollama
Ollama runs embedding models locally. No API key is required.
Install:
pip install "mcp-project-context-server[ollama]"Prerequisites: Install Ollama and pull an embedding model:
ollama pull nomic-embed-textEnvironment Variables:
Variable | Default | Description |
| — | Must be set to |
|
| URL of the Ollama server |
|
| Embedding model to use |
Example:
export EMBED_PROVIDER=ollama
export OLLAMA_HOST=http://localhost:11434 # Optional — this is the default
export OLLAMA_EMBED_MODEL=nomic-embed-text # Optional — this is the defaultPopular models:
Model | Size | Notes |
| ~274 MB | Fast, good general purpose |
| ~669 MB | Higher quality |
| ~46 MB | Lightweight, lower quality |
Voyage AI
Voyage AI provides embedding models optimized for code and technical content.
Install:
pip install "mcp-project-context-server[voyage]"Getting an API Key:
Sign up at voyageai.com
Navigate to Dashboard → API Keys
Click Create new key, give it a name, and copy the key value
Environment Variables:
Variable | Default | Description |
| — | Must be set to |
| — | Required. Your Voyage AI API key |
|
| Embedding model to use |
|
| Initial backoff delay (seconds) when Voyage AI returns a transient error (429, 5xx, timeout, connection reset); doubles each retry, up to 4 attempts |
Example:
export EMBED_PROVIDER=voyage
export VOYAGE_API_KEY=pa-...
export VOYAGE_EMBED_MODEL=voyage-code-3 # Optional
export VOYAGE_BACKOFF_INITIAL_DELAY=300 # OptionalRecommended models:
Model | Notes |
| Code-optimized, default |
| General purpose |
| Faster, lower cost |
OpenAI
Install:
pip install "mcp-project-context-server[openai]"Getting an API Key:
Sign up or log in at platform.openai.com
Navigate to Dashboard → API Keys
Click Create new secret key, give it a name, and copy the key immediately — it is only shown once
Billing note: OpenAI API access is pay-per-use. Add a payment method at platform.openai.com/account/billing before your free credits run out.
Environment Variables:
Variable | Default | Description |
| — | Must be set to |
| — | Required. Your OpenAI API key |
|
| Embedding model to use |
Example:
export EMBED_PROVIDER=openai
export OPENAI_API_KEY=sk-...
export OPENAI_EMBED_MODEL=text-embedding-3-small # OptionalRecommended models:
Model | Dimensions | Notes |
| 1536 | Fast, cost-effective, default |
| 3072 | Highest quality |
Cohere
Install:
pip install "mcp-project-context-server[cohere]"Getting an API Key:
Sign up or log in at dashboard.cohere.com
Navigate to API Keys in the left sidebar
Click New Trial Key (free tier, rate-limited) or New Production Key, then copy the value
Environment Variables:
Variable | Default | Description |
| — | Must be set to |
| — | Required. Your Cohere API key |
|
| Embedding model to use |
Example:
export EMBED_PROVIDER=cohere
export COHERE_API_KEY=...
export COHERE_EMBED_MODEL=embed-english-v3.0 # OptionalRecommended models:
Model | Notes |
| English, default |
| 100+ languages |
Google Gemini
Uses the Google AI Studio API (Gemini embedding models).
Install:
pip install "mcp-project-context-server[google]"Getting an API Key:
Sign in at aistudio.google.com
Click Get API key in the top navigation
Click Create API key — choose an existing Google Cloud project or create a new one
Copy the generated key
Note: Google AI Studio keys are suitable for development and personal use. For production workloads with higher quotas and enterprise SLAs, use Google Vertex AI instead.
Environment Variables:
Variable | Default | Description |
| — | Must be set to |
| — | Required. Your Google AI Studio API key |
|
| Embedding model to use |
Example:
export EMBED_PROVIDER=google
export GOOGLE_API_KEY=AIza...
export GOOGLE_EMBED_MODEL=text-embedding-004 # OptionalGoogle Vertex AI
Uses the Vertex AI SDK with Google Cloud Application Default Credentials (ADC). No API key is required — authentication is handled through your Google Cloud identity.
Install:
pip install "mcp-project-context-server[google-vertex]"Prerequisites:
Enable the Vertex AI API in your Google Cloud project:
Search for Vertex AI API and click Enable
Authenticate using Application Default Credentials. For local development:
gcloud auth application-default loginFor production environments (e.g. Cloud Run, GKE), assign a service account with the Vertex AI User role (
roles/aiplatform.user) to your workload, and setGOOGLE_APPLICATION_CREDENTIALSif using a key file.
Environment Variables:
Variable | Default | Description |
| — | Must be set to |
| — | Required. Your Google Cloud project ID |
| — | Required. Google Cloud region (e.g. |
|
| Embedding model to use |
Example:
export EMBED_PROVIDER=vertexai
export VERTEXAI_PROJECT=my-gcp-project-id
export VERTEXAI_LOCATION=us-central1
export VERTEXAI_EMBED_MODEL=text-embedding-004 # Optional🗄️ Vector Stores
The vector store is selected by the VECTOR_STORE_PROVIDER environment variable. Defaults to chroma-local.
Supported values: chroma-local, chroma-http, pgvector
ChromaDB Local (Default)
Persists embeddings in a local directory. Included in the core package — no extra installation required.
Environment Variables:
Variable | Default | Description |
|
| Set to |
|
| Directory where ChromaDB stores its data |
Example:
export VECTOR_STORE_PROVIDER=chroma-local # Optional — this is the default
export CHROMA_DIR=~/.mcp-data/chroma # Optional — this is the defaultChromaDB HTTP
Connects to a remote or containerized ChromaDB instance over HTTP.
Environment Variables:
Variable | Default | Description |
|
| Must be set to |
|
| ChromaDB server hostname |
|
| ChromaDB server port |
| (none) | API key for ChromaDB Cloud or authenticated instances |
Example:
export VECTOR_STORE_PROVIDER=chroma-http
export CHROMA_HOST=chroma.example.com
export CHROMA_PORT=8000
export CHROMA_API_KEY=your-chroma-api-key # Optionalpgvector (PostgreSQL)
Stores embeddings in a PostgreSQL database using the pgvector extension.
Install:
pip install "mcp-project-context-server[pgvector]"Prerequisites: A PostgreSQL instance (13+) with the pgvector extension enabled:
CREATE EXTENSION IF NOT EXISTS vector;Environment Variables:
Variable | Default | Description |
|
| Must be set to |
| — | Required. PostgreSQL connection string |
Example:
export VECTOR_STORE_PROVIDER=pgvector
export PGVECTOR_CONNECTION_STRING=postgresql://user:password@localhost:5432/mydb📁 Repository Providers
The repository provider controls where the server reads project files from. Defaults to local.
Supported values: local, github, gitlab, gitea
Local Filesystem (Default)
Reads files from the local filesystem. No additional configuration required.
Environment Variables:
Variable | Default | Description |
|
| Set to |
| (from tool call) | Override the project path at server startup |
GitHub
Reads files from GitHub repositories via the GitHub REST API.
Getting a Personal Access Token:
Click Generate new token (classic) or Fine-grained personal access tokens
Classic: grant the
reposcope (orpublic_repofor public repositories only)Fine-grained: grant Contents: Read-only on the target repositories
Copy the generated token
Environment Variables:
Variable | Default | Description |
|
| Must be set to |
| (empty) | GitHub personal access token. Required for private repos |
|
| Override for GitHub Enterprise Server |
|
| Default branch when none is specified |
Example:
export REPO_PROVIDER=github
export REPO_AUTH_TOKEN=ghp_...
# GitHub Enterprise only:
export REPO_BASE_URL=https://github.example.com/api/v3GitLab
Reads files from GitLab repositories via the GitLab REST API.
Getting a Personal Access Token:
Navigate to User Settings → Access Tokens (profile menu → Edit profile → Access Tokens)
Click Add new token
Grant at minimum the
read_apiscopeSet an expiry date and click Create personal access token
Copy the token immediately — it is not shown again
Environment Variables:
Variable | Default | Description |
|
| Must be set to |
| (empty) | GitLab personal access token |
|
| Override for self-hosted GitLab instances |
|
| Default branch when none is specified |
Example:
export REPO_PROVIDER=gitlab
export REPO_AUTH_TOKEN=glpat-...
# Self-hosted GitLab only:
export REPO_BASE_URL=https://gitlab.example.comGitea
Reads files from self-hosted Gitea instances. REPO_BASE_URL is required.
Getting an Access Token:
Log in to your Gitea instance
Go to Settings → Applications (your user avatar → Settings → Applications)
Under Manage Access Tokens, enter a name, select the desired permissions, and click Generate Token
Copy the generated token — it is only shown once
Environment Variables:
Variable | Default | Description |
|
| Must be set to |
| — | Required. Your Gitea instance URL (e.g. |
| (empty) | Gitea access token |
|
| Default branch when none is specified |
Example:
export REPO_PROVIDER=gitea
export REPO_BASE_URL=https://gitea.example.com
export REPO_AUTH_TOKEN=...Multi-Tenant Mode
All repository providers support multi-tenant mode, which restricts file access to an allowlist of approved organizations and repositories. Enable it with REPO_MULTI_TENANT=true.
At least one of APPROVED_ORGS or APPROVED_REPOS must be set when multi-tenant mode is active.
Variable | Default | Description |
|
| Set to |
| (none) | Comma-separated list of approved organization names |
| (none) | Comma-separated list of approved |
Example:
export REPO_MULTI_TENANT=true
export APPROVED_ORGS=my-org,partner-org
export APPROVED_REPOS=other-org/specific-repo🚌 Transport
The transport is selected by the MCP_TRANSPORT environment variable. Defaults to stdio.
stdio (Default)
Standard input/output transport. Compatible with Claude Desktop, Claude Code, Cursor, Continue, VS Code Copilot, and most other MCP clients. No additional installation or configuration required.
export MCP_TRANSPORT=stdio # Optional — this is the default
project-context-serverHTTP/SSE
HTTP/SSE transport for remote deployments, team servers, and cloud integrations.
Install:
pip install "mcp-project-context-server[sse]"Start the server:
export MCP_TRANSPORT=sse
export MCP_HOST=0.0.0.0 # Optional — default is 0.0.0.0
export MCP_PORT=8080 # Optional — default is 8080
project-context-serverThe server exposes two endpoints:
GET /sse— SSE connection endpoint for MCP clientsGET /health— unauthenticated health check
Authentication:
| Description |
| No authentication. Use only on trusted private networks. |
| Static token via |
| Google Cloud identity token validation. For use with Agent Engine and service-to-service calls. |
Bearer token example:
export MCP_TRANSPORT=sse
export MCP_AUTH_TYPE=bearer
export MCP_AUTH_TOKEN=your-secret-token
project-context-serverGoogle IAM example:
export MCP_TRANSPORT=sse
export MCP_AUTH_TYPE=google-iam
export GOOGLE_IAM_AUDIENCE=https://my-service.example.com # Recommended
export GOOGLE_APPROVED_SERVICE_ACCOUNTS=sa@project.iam.gserviceaccount.com # Optional allowlist
project-context-serverSSE environment variables:
Variable | Default | Description |
|
| Must be set to |
|
| Bind address |
|
| Listen port |
|
| Authentication: |
| — | Required when |
| (none) | Expected |
| (none) | Path to service account JSON key (uses ADC if unset) |
| (none) | Comma-separated allowed caller service account emails |
🖥️ Client Setup
The examples below use Ollama as the embedding provider and ChromaDB local as the vector store — the simplest setup with no API key requirements. Substitute environment variables for your chosen providers using the reference in Embedding Providers and Vector Stores.
Detailed client docs with full per-provider configuration matrices are available in
docs/clients/. Those docs are currently being updated to correct some environment variable names from the old implementation — seedocs/client-setup-expansion.mdfor status and the correct variable reference.
Claude Desktop
Install the server:
pip install "mcp-project-context-server[ollama]"Locate the config file for your OS:
OS
Config File
Windows
%APPDATA%\Claude\claude_desktop_config.jsonmacOS
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux
~/.config/Claude/claude_desktop_config.jsonAdd the server to
claude_desktop_config.json:Windows:
{ "mcpServers": { "project-context": { "command": "python", "args": ["-m", "mcp_project_context_server"], "env": { "EMBED_PROVIDER": "ollama", "OLLAMA_HOST": "http://localhost:11434", "OLLAMA_EMBED_MODEL": "nomic-embed-text" } } } }macOS / Linux:
{ "mcpServers": { "project-context": { "command": "python", "args": ["-m", "mcp_project_context_server"], "env": { "EMBED_PROVIDER": "ollama", "OLLAMA_HOST": "http://localhost:11434", "OLLAMA_EMBED_MODEL": "nomic-embed-text" } } } }Restart Claude Desktop and verify the server appears in the MCP tools list.
Claude Code
Install the server:
pip install "mcp-project-context-server[ollama]"Add the MCP server using one of two methods:
Option A — CLI:
claude mcp add project-context \ -e EMBED_PROVIDER=ollama \ -e OLLAMA_HOST=http://localhost:11434 \ -e OLLAMA_EMBED_MODEL=nomic-embed-text \ -- python -m mcp_project_context_serverOption B — Config file:
Scope
Location
User (global)
~/.claude.jsonProject
.claude/settings.json(in project root){ "mcpServers": { "project-context": { "command": "python", "args": ["-m", "mcp_project_context_server"], "env": { "EMBED_PROVIDER": "ollama", "OLLAMA_HOST": "http://localhost:11434", "OLLAMA_EMBED_MODEL": "nomic-embed-text" } } } }Verify the server is connected:
claude mcp list
Cursor
Install the server (see Installation)
Choose a config scope:
Scope
Windows
macOS / Linux
Global
%USERPROFILE%\.cursor\mcp.json~/.cursor/mcp.jsonProject
.cursor\mcp.json(project root).cursor/mcp.json(project root)Configure
mcp.json:{ "mcpServers": { "project-context": { "command": "python", "args": ["-m", "mcp_project_context_server"], "env": { "EMBED_PROVIDER": "ollama", "OLLAMA_HOST": "http://localhost:11434", "OLLAMA_EMBED_MODEL": "nomic-embed-text" } } } }Reload Cursor and use
@project-contextin the chat panel.
Continue
Install the Continue extension for VS Code or JetBrains
Locate the config file:
OS
Config File
Windows
%USERPROFILE%\.continue\config.yamlmacOS / Linux
~/.continue/config.yamlAdd to
config.yaml:mcpServers: - name: project-context command: python args: - "-m" - mcp_project_context_server env: EMBED_PROVIDER: "ollama" OLLAMA_HOST: "http://localhost:11434" OLLAMA_EMBED_MODEL: "nomic-embed-text"Or if using
config.json:{ "mcpServers": [ { "name": "project-context", "command": "python", "args": ["-m", "mcp_project_context_server"], "env": { "EMBED_PROVIDER": "ollama", "OLLAMA_HOST": "http://localhost:11434", "OLLAMA_EMBED_MODEL": "nomic-embed-text" } } ] }
Windsurf
Install the server (see Installation)
Locate the MCP config file:
OS
Config File
Windows
%USERPROFILE%\.codeium\windsurf\mcp_config.jsonmacOS / Linux
~/.codeium/windsurf/mcp_config.jsonConfigure
mcp_config.json(create if it does not exist):{ "mcpServers": { "project-context": { "command": "python", "args": ["-m", "mcp_project_context_server"], "env": { "EMBED_PROVIDER": "ollama", "OLLAMA_HOST": "http://localhost:11434", "OLLAMA_EMBED_MODEL": "nomic-embed-text" } } } }Restart Windsurf and verify the server appears under Settings → MCP Servers.
VS Code Copilot
MCP support is built into VS Code via GitHub Copilot (no separate extension required). Requires VS Code 1.99+ with the Copilot extension.
Install the server (see Installation)
Choose a config scope:
Option A — Workspace (
.vscode/mcp.json):{ "servers": { "project-context": { "type": "stdio", "command": "python", "args": ["-m", "mcp_project_context_server"], "env": { "EMBED_PROVIDER": "ollama", "OLLAMA_HOST": "http://localhost:11434", "OLLAMA_EMBED_MODEL": "nomic-embed-text" } } } }Option B — User settings (
settings.json):{ "mcp": { "servers": { "project-context": { "type": "stdio", "command": "python", "args": ["-m", "mcp_project_context_server"], "env": { "EMBED_PROVIDER": "ollama", "OLLAMA_HOST": "http://localhost:11434", "OLLAMA_EMBED_MODEL": "nomic-embed-text" } } } } }Use in Copilot Chat by switching to Agent mode — MCP tools are available automatically.
🛠️ Tools Reference
Tool | Description |
| Indexes all files in |
| Performs semantic search over indexed context |
| Returns the full contents of |
| Writes a session note to |
| Lists available repositories via the configured repository provider |
Usage Examples
# Semantic search
search_project_context(
query="How do we handle authentication?",
n_results=5
)
# Load full context
load_project_context()
# Returns: project.md, all ADRs, latest session file
# Save session notes
save_session_summary(
summary="Investigated chunking strategy alternatives, decided on fixed-size for now"
)
# Rebuild the index
index_project_context()🌐 Environment Variables Reference
Embedding Providers
Variable | Provider | Default | Required |
| All | — | Yes |
|
|
| No |
|
|
| No |
|
| — | Yes |
|
|
| No |
|
|
| No |
|
| — | Yes |
|
|
| No |
|
| — | Yes |
|
|
| No |
|
| — | Yes |
|
|
| No |
|
| — | Yes |
|
| — | Yes |
|
|
| No |
Vector Stores
Variable | Store | Default | Required |
| All |
| No |
|
|
| No |
|
|
| No |
|
|
| No |
|
| (none) | No |
|
| — | Yes (for pgvector) |
Repository Providers
Variable | Provider | Default | Required |
| All |
| No |
|
| (from tool call) | No |
|
| (empty) | No (required for private repos) |
|
| (provider default) | Yes for |
|
|
| No |
| All |
| No |
| All (multi-tenant) | (none) | Yes (if multi-tenant, with no APPROVED_REPOS) |
| All (multi-tenant) | (none) | Yes (if multi-tenant, with no APPROVED_ORGS) |
Transport
Variable | Default | Required |
|
| No |
|
| No |
|
| No |
|
| No |
| — | Yes (if |
| (none) | No |
| (none) | No |
| (none) | No |
📂 Project Structure
mcp-project-context-server/
├── src/mcp_project_context_server/
│ ├── server.py # MCP server entry point and tool registry
│ ├── exceptions.py # Shared exception types
│ ├── tools/
│ │ ├── index_context.py # index_project_context tool
│ │ ├── search_context.py # search_project_context tool
│ │ ├── load_context.py # load_project_context tool
│ │ ├── save_session.py # save_session_summary tool
│ │ └── list_repositories.py # list_repositories tool
│ ├── integrations/
│ │ ├── embeddings/
│ │ │ ├── base.py # EmbeddingProvider Protocol
│ │ │ ├── registry.py # Provider factory (EMBED_PROVIDER)
│ │ │ ├── ollama/client.py
│ │ │ ├── voyage/client.py
│ │ │ ├── openai/client.py
│ │ │ ├── cohere/client.py
│ │ │ ├── google/client.py
│ │ │ └── vertexai/client.py
│ │ ├── vectorstore/
│ │ │ ├── base.py # VectorStoreProvider Protocol
│ │ │ ├── registry.py # Provider factory (VECTOR_STORE_PROVIDER)
│ │ │ ├── chroma_local/client.py
│ │ │ ├── chroma_http/client.py
│ │ │ └── pgvector/client.py
│ │ ├── repository/
│ │ │ ├── base.py # RepositoryProvider Protocol
│ │ │ ├── registry.py # Provider factory (REPO_PROVIDER)
│ │ │ ├── local/client.py
│ │ │ ├── github/client.py
│ │ │ ├── gitlab/client.py
│ │ │ └── gitea/client.py
│ │ └── transport/
│ │ ├── stdio.py
│ │ └── sse.py
│ └── helpers/
│ └── context.py # Utility functions
├── .context/ # Project context directory
│ ├── project.md # Project overview
│ ├── sessions/ # Session notes
│ └── decisions/ # Architecture Decision Records
├── tests/
│ ├── unit/ # Unit tests (mocked dependencies)
│ └── integration/ # Integration tests (real services)
├── docs/
│ └── client-setup-expansion.md # Per-provider client setup expansion plan
├── README.md
├── CONTRIBUTING.md
├── pyproject.toml
└── LICENSE🧪 Testing
Run the Test Suite
# Install test dependencies
pip install "mcp-project-context-server[all]"
pip install pytest pytest-asyncio pytest-mock pytest-cov
# Unit tests (no external services required)
pytest tests/unit/
# Integration tests (requires a running embedding provider and vector store)
pytest tests/integration/
# All tests with coverage report
pytest --cov=src/mcp_project_context_server tests/Development Workflow
# Format and lint
black src/
isort src/
flake8 src/
mypy src/
# Check coverage
pytest --cov=src/mcp_project_context_server --cov-report=term-missing tests/unit/🔮 Roadmap
Auto-reindex: Watchdog-based file monitoring for automatic reindexing
Codebase Indexing: Repomix integration for source code analysis
Enhanced ADR Tools: First-class MCP tools for ADR lifecycle management
Batch Operations: Bulk ADR updates and session imports
Provider Caching: Singleton caching for embedding and vector store providers
🤝 Contributing
Contributions are welcome! See CONTRIBUTING.md for detailed guidelines including commit message standards, ADR requirements, and the PR process.
📝 License
This project is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3 — see the LICENSE file for details.
🙏 Acknowledgments
MCP Team: For the Model Context Protocol
ChromaDB: For the embedded vector store
Ollama: For local embedding model hosting
Built with ❤️ for better LLM project understanding
Available Tools
22 toolsbootstrap_contextA
Atomically scaffold a brand-new .context/ directory for a project that doesn't have one yet: creates decisions/ and sessions/, writes the bundled ADR_CREATE_AND_MANAGEMENT.md and PLANNING_LOOP.md governance docs, writes an interview-driven project.md (answers from get_bootstrap_questions), and creates a governance ADR-00001 establishing the project's ADR process. Every step is additive and idempotent — artifacts that already exist are skipped, not overwritten. If the repository has a .project-bootstrap-questions.yaml file at its root, its questions are merged into the interview set used for project.md.
Inputs: project_name (required), project_path (required), auto_reindex, project_sections.
create_adrA
Create a new ADR: allocates the next sequential number, writes a 'Proposed'-status stub with the given title and context, and placeholder text in the remaining sections (Decision, Consequences, Alternatives Considered, ADR Review Discussion). No lock/retry against concurrent creation.
Inputs: title (required), context (required), project_path (required), auto_reindex.
edit_adrA
Replace a single named top-level (##) section of one ADR. Rejects the 'Status' section — use update_adr_status for status transitions instead.
Inputs: content (required), section (required), project_path (required), number_or_filename (required), +1 more.
edit_projectB
Replace a single named top-level (##) section of .context/project.md.
Inputs: content (required), section (required), project_path (required), auto_reindex.
find_latest_session_fileA
Deterministically find the most recent .context/sessions/*.md file (sorted by filename, not semantic relevance). Pass the returned path to load_context_files to load it — do not rely on this tool's snippets alone.
Inputs: project_path (required).
get_bootstrap_questionsA
Get the interview question set for a bootstrap artifact (currently 'project', for .context/project.md). Ask the user each question, then pass the answers as project_sections to bootstrap_context. Pass project_path to also merge in any repo-supplied custom questions from a .project-bootstrap-questions.yaml file at the repository root.
Inputs: target, project_path.
index_project_contextB
Re-index the .context/ directory into the vector store. Run this after updating project.md, adding ADRs, or refreshing BUNDLE.md.
Inputs: project_path (required).
list_adrsA
List every ADR in .context/decisions/ as a lightweight table (number, title, status, filename). Use this before read_adr/read_adr_section to find which ADR you need, without loading full ADR content.
Inputs: project_path (required).
list_adr_sectionsA
List one ADR's top-level (##) section names, in document order.
Inputs: project_path (required), number_or_filename (required).
list_repositoriesA
List repositories accessible via the configured repository provider. In multi-tenant deployments, use this to discover which repositories are available before calling other tools. Optionally filter by organisation name.
Inputs: org.
load_context_filesA
Load specific .context/-relative files into the active context. Each loaded file is tagged with its path and a SHA-512 hash of its contents so reload_active_context_file can later detect changes. Only pass files you actually need — do not load the whole .context/ tree.
Inputs: files (required), project_path (required).
read_adrA
Read one ADR's full raw content by number or filename, tagged with its path and SHA-512 hash so reload_active_context_file can later detect changes. Prefer read_adr_section when you only need one section.
Inputs: project_path (required), number_or_filename (required).
read_adr_sectionA
Read a single named top-level (##) section of one ADR (e.g. 'Context', 'Decision', 'Consequences'). Use list_adr_sections first if you don't know the exact section name.
Inputs: section (required), project_path (required), number_or_filename (required).
read_adr_statusA
Read one ADR's title and parsed Status without loading its full content. Returns an explicit message for ADRs using the legacy **Status:** inline format.
Inputs: project_path (required), number_or_filename (required).
reload_active_context_fileA
Check whether files currently held in active context (previously loaded via load_context_files) have changed on disk, by comparing their known SHA-512 hash against the current one. Returns fresh tagged content for changed files, a short 'no change' message for unchanged files, and 'not found' for deleted files.
Inputs: files (required), project_path (required).
save_session_summaryA
Save a summary of the current session to .context/sessions/YYYY-MM-DD.md. Call this at the end of a session with a concise summary of what was done.
Inputs: summary (required), project_path (required).
search_adr_indexA
Semantically search only the architecture decision records under .context/decisions/. Use this to find ADRs relevant to your current task, then pass their paths to load_context_files — do not rely on this tool's snippets alone. If you need to search across all files in the project, use search_project_files instead.
Inputs: query (required), project_path (required), n_results. Returns: results, warning
search_adr_sectionsA
Semantically search within a single resolved ADR, scoped by number or filename. Use this to find relevant sections/passages inside one ADR you've already identified (e.g. via list_adrs or search_adr_index).
Inputs: query (required), project_path (required), number_or_filename (required), n_results. Returns: results, warning
search_context_indexA
Semantically search the whole indexed project context. Use this first to find which files are relevant to your task, then pass their paths to load_context_files — do not rely on this tool's snippets alone.
Inputs: query (required), project_path (required), n_results. Returns: results, warning
search_session_filesA
Semantically search only past session summaries under .context/sessions/. Use this to find prior session notes relevant to a topic, then pass their paths to load_context_files — do not rely on this tool's snippets alone.
Inputs: query (required), project_path (required), n_results. Returns: results, warning
update_adr_statusA
Transition one ADR's Status, with lifecycle guardrails: rejects unknown statuses; requires the target ADR to already exist for 'Superseded by ADR-XXXXX'; requires an 'explanation' for unusual (non-adjacent-forward) transitions; requires a populated Decision section (or an 'explanation' to fold into it) before moving to 'Accepted'; and removes the 'ADR Review Discussion' section once 'Accepted' is reached.
Inputs: new_status (required), project_path (required), number_or_filename (required), explanation, +1 more.
write_projectC
Overwrite the full content of .context/project.md.
Inputs: content (required), project_path (required), auto_reindex.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 22 tools
Each tool targets a distinct resource and action—ADRs, project files, sessions, index, and context loading—with clear boundaries. Even overlapping tools like read_adr vs read_adr_section are sharply differentiated, and the search tools are scoped by file type.
All 22 tools follow a consistent verb_noun snake_case pattern (load_context_files, list_adrs, create_adr, update_adr_status, bootstrap_context, etc.). No mixed conventions or vague verbs.
22 tools is on the heavier side but justified by the breadth of the domain: ADR lifecycle, project management, sessions, context indexing, and bootstrap. Each tool has a clear role, though a few could potentially be consolidated.
The surface covers the full .context lifecycle: bootstrap, project file management, ADR CRUD (minus delete), session saving/searching, and context reload. Minor gaps exist—no explicit session listing or ADR deletion—but these are workarounds via other tools.
Maintenance
Related MCP Connectors
Cloud-hosted MCP server for durable AI memory
An MCP server that gives your AI access to the source code and docs of all public github repos
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Related MCP Servers
- AlicenseAqualityBmaintenanceA local-first MCP server that gives AI coding agents persistent memory and controlled commands. Features a git-backed markdown knowledge vault with FTS5 search, surgical section edits, token-aware context budgeting, and a sandboxed command engine with human approval gates. Works with Claude Code, Cursor, Copilot, Gemini, and more.62532 npm1Apache 2.0
- AlicenseNot gradedqualityDmaintenanceA local-first MCP server that turns a .context/ folder of markdown files into a searchable knowledge layer for AI coding agents.15 npm2MIT
- AlicenseAqualityDmaintenanceA local-first MCP server that gives AI coding assistants persistent, structured, human-readable memory for a software project by storing project knowledge as Markdown files in the project's .dev-context-memory/ folder.71MIT
- AlicenseNot gradedqualityAmaintenanceA local MCP server that gives LLMs long-term memory by indexing code, infrastructure, logs, and docs into a queryable graph. It enables semantic and structural search, evidence-backed reasoning, and tracked plans that persist across sessions and teams.1Apache 2.0