ericbrown/project-context-mcp

πŸ’» Developer Tools
0 Views
0 Installs

🐍 🏠 - Exposes .context/ folder files as MCP resources, giving Claude Code instant access to project documentation via @ mentions.

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "ericbrown-project-context-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "ericbrown-project-context-mcp"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

project-context-mcp

PyPI version License: MIT Python 3.10+

Give Claude Code instant access to your project's institutional knowledge.

An MCP server that makes your project documentation instantly accessible in Claude Code through @ mentions. Create a .context/ folder, add your docs, and watch Claude become an expert on your codebase.


The Problem

You're working with Claude Code on a complex project. Claude is smart, but it doesn't know:

  • Your team's coding conventions
  • Why you chose that weird architecture
  • The gotchas in your database schema
  • Your API design patterns
  • That one thing that breaks if you don't do it just right

You end up copy-pasting the same context into every conversation. Or worse, Claude makes suggestions that violate your project's conventions.

The Solution

Create a .context/ folder in your project. Drop in your documentation. Now when you type @ in Claude Code, your context files appear right alongside your source files:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  > Help me add a new API endpoint @                         β”‚
β”‚                                                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ Suggestions:                                         β”‚   β”‚
β”‚  β”‚   πŸ“„ src/api/routes.py                              β”‚   β”‚
β”‚  β”‚   πŸ“„ src/models/user.py                             β”‚   β”‚
β”‚  β”‚   πŸ“˜ architecture.md          <- Your context!      β”‚   β”‚
β”‚  β”‚   πŸ“˜ api-patterns.md          <- Your context!      β”‚   β”‚
β”‚  β”‚   πŸ“˜ conventions.md           <- Your context!      β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

One @api-patterns.md mention and Claude knows exactly how you structure endpoints.


Quick Start

1. Install the MCP server (one time)

claude mcp add project-context -s user -- uvx project-context-mcp

That's it. The server is now available in all your Claude Code sessions.

2. Create a .context/ folder in your project

my-project/
β”œβ”€β”€ .context/               <- Create this folder
β”‚   β”œβ”€β”€ architecture.md
β”‚   β”œβ”€β”€ conventions.md
β”‚   └── api-patterns.md
β”œβ”€β”€ src/
β”œβ”€β”€ tests/
└── ...

3. Use @ to include context

> Help me refactor this function @conventions.md
> Add a new database table @database-schema.md @naming-conventions.md
> Why is this test failing? @architecture.md @testing-patterns.md

What to Put in .context/

Your .context/ folder is for institutional knowledge β€” the stuff that isn't obvious from reading the code.

Recommended Files

FileWhat to Include
architecture.mdSystem overview, component relationships, data flow diagrams
conventions.mdCoding standards, naming conventions, file organization
api-patterns.mdEndpoint structure, authentication, error handling patterns
database-schema.mdTable relationships, naming conventions, migration patterns
testing-patterns.mdTest organization, mocking strategies, fixture patterns
deployment.mdEnvironment setup, deployment procedures, rollback steps
gotchas.mdKnown issues, workarounds, "don't do this" warnings
glossary.mdDomain-specific terms, abbreviations, business logic

Example: conventions.md

# Coding Conventions

## Naming
- Files: `snake_case.py`
- Classes: `PascalCase`
- Functions: `snake_case`
- Constants: `UPPER_SNAKE_CASE`

## Error Handling
- Use custom exceptions from `src/exceptions.py`
- Always log with context: `logger.error("Failed to process", extra={"user_id": id})`
- API endpoints return `{"error": {"code": "...", "message": "..."}}`

## Testing
- One test file per module: `test_<module_name>.py`
- Use fixtures from `conftest.py`, don't create new ones without discussion
- Mock external services, never hit real APIs in tests

Example: architecture.md

# Architecture Overview

## System Components

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Next.js   │────▢│   FastAPI   │────▢│  PostgreSQL β”‚
β”‚  Frontend   β”‚     β”‚   Backend   β”‚     β”‚   Database  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           β–Ό
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚    Redis    β”‚
                    β”‚    Cache    β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

## Key Design Decisions

1. **Why FastAPI over Flask?**
   - Native async support for high-concurrency endpoints
   - Automatic OpenAPI documentation
   - Pydantic validation built-in

2. **Why Redis for caching?**
   - Session storage for horizontal scaling
   - Rate limiting with sliding windows
   - Pub/sub for real-time features

Supported File Types

The server exposes files with these extensions:

CategoryExtensions
Documentation.md, .txt, .rst, .asciidoc, .adoc
Data/Config.yaml, .yml, .json, .toml, .xml, .csv, .ini, .cfg, .conf
Code Examples.py, .js, .ts, .jsx, .tsx, .html, .css, .sql, .sh

Automatically excluded: Hidden files (.foo), __pycache__, node_modules, .git, .DS_Store


Features

Smart Resource Names

The server extracts human-readable names from your files:

  • Markdown files: Uses the first # Heading as the name
  • Other files: Converts filename to title case (api-patterns.md β†’ "Api Patterns")

Automatic Descriptions

First paragraph of each file becomes the description shown in autocomplete, helping you pick the right context quickly.

Nested Folders

Organize complex documentation with subfolders:

.context/
β”œβ”€β”€ architecture.md
β”œβ”€β”€ api/
β”‚   β”œβ”€β”€ authentication.md
β”‚   β”œβ”€β”€ pagination.md
β”‚   └── error-codes.md
β”œβ”€β”€ database/
β”‚   β”œβ”€β”€ schema.md
β”‚   └── migrations.md
└── frontend/
    β”œβ”€β”€ components.md
    └── state-management.md

All files are discovered recursively and accessible via @.

Zero Configuration

No config files. No setup. No environment variables. Just create .context/ and go.


How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Claude Code    │◀───────▢│  project-context-mcp β”‚
β”‚                  β”‚   MCP   β”‚                     β”‚
β”‚  You type: @     β”‚ Protocolβ”‚  1. Finds .context/ β”‚
β”‚                  β”‚         β”‚  2. Lists all files β”‚
β”‚  Server returns  │◀────────│  3. Returns as      β”‚
β”‚  your docs as    β”‚         β”‚     MCP resources   β”‚
β”‚  suggestions     β”‚         β”‚                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  1. On startup: MCP server checks current directory for .context/
  2. On @ keystroke: Claude Code requests available resources
  3. Server responds: List of files with names, descriptions, and URIs
  4. On selection: File content is fetched and included in your prompt

URI Scheme

Resources use the context:// scheme:

  • .context/architecture.md β†’ context://architecture.md
  • .context/api/patterns.md β†’ context://api/patterns.md

Use Cases

Onboarding New Team Members

Share your .context/ folder in your repo. New developers get the same Claude experience as veterans β€” Claude knows the conventions from day one.

Enforcing Consistency

Instead of hoping everyone remembers the coding standards, put them in .context/conventions.md. Claude will suggest code that matches your patterns.

Complex Domains

Working in healthcare? Finance? Legal tech? Put your domain glossary and business rules in .context/. Claude won't confuse your specific terminology.

Legacy Codebases

Document the "why" behind legacy decisions. When Claude suggests a refactor, you can include @legacy-decisions.md to explain constraints.

Multi-Service Architecture

Keep architecture docs in context. Claude can help you make changes that respect service boundaries and communication patterns.


Comparison

ApproachProsCons
Copy-paste contextNo setupTedious, inconsistent, clutters prompt
CLAUDE.md fileAuto-includedSingle file, always included even when not relevant
.context/ folderOrganized, selective, discoverableRequires explicit @ mention

This tool is ideal when you have multiple context documents and want to selectively include the relevant ones for each task.


Installation Options

Recommended: uvx (no install needed)

claude mcp add project-context -s user -- uvx project-context-mcp

Alternative: pip install

pip install project-context-mcp
claude mcp add project-context -s user -- project-context-mcp

Development: from source

git clone https://github.com/ericbrown/project-context-mcp.git
cd project-context-mcp
pip install -e .
claude mcp add project-context -s user -- python -m project_context_mcp.server

Troubleshooting

Context files not appearing?

  1. Check the folder name: Must be exactly .context/ (with the dot)
  2. Check file extensions: Only supported types are included
  3. Restart Claude Code: MCP servers initialize on startup
  4. Check server is registered: Run claude mcp list

Want to see what's discovered?

Run the server directly to see logs:

cd your-project
python -m project_context_mcp.server

You'll see:

INFO:project-context-mcp:Starting project-context-mcp server
INFO:project-context-mcp:Working directory: /path/to/your-project
INFO:project-context-mcp:Looking for context in: /path/to/your-project/.context
INFO:project-context-mcp:Found 5 context resources

Contributing

Contributions welcome! Ideas for improvements:

  • File watching for hot reload
  • context.yaml manifest for custom metadata
  • Search tool to find content across context files
  • Support for remote context (URLs, Notion, Confluence)
  • Team sync via cloud storage

Development Setup

git clone https://github.com/ericbrown/project-context-mcp.git
cd project-context-mcp
pip install -e .

Running Tests

cd examples/sample-project
python -m project_context_mcp.server

License

MIT License β€” see LICENSE for details.


Related


Built for developers who are tired of repeating themselves.

Star this repo if it saves you time!

Related MCP Servers

Moxie-Docs-MCPβ˜… Featured

MCP & Agent Skills for Automated Documentation, and codebase conventions + context

πŸ’» Developer Tools2 views
3KniGHtcZ/codebeamer-mcp

πŸ“‡ ☁️ 🍎 πŸͺŸ 🐧 - Codebeamer ALM integration for managing work items, trackers, and projects. Provides 17 tools for reading and writing items, associations, references, comments, and risk management data via Codebeamer REST API v3.

πŸ’» Developer Tools1 views
21st-dev/Magic-MCP

Create crafted UI components inspired by the best 21st.dev design engineers.

πŸ’» Developer Tools0 views
a-25/ios-mcp-code-quality-server

πŸ“‡ 🏠 🍎 - iOS code quality analysis and test automation server. Provides comprehensive Xcode test execution, SwiftLint integration, and detailed failure analysis. Operates in both CLI and MCP server modes for direct developer usage and AI assistant integration.

πŸ’» Developer Tools0 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Not checked yet

We have not completed a health check for this listing yet.

Last checked: 7/29/2026, 1:09:48 AM

Unclaimed listing (imported or pending owner verification). Claim it β†’
β˜… Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.