Context File MCP Service
Provides tools to fetch and manage context files from GitHub repositories, supporting both public and private repositories via personal access tokens.
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., "@Context File MCP Service Show me all context files tagged 'api'"
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.
Context File MCP Service
A powerful Model Context Protocol (MCP) service for managing AI context files from local directories and GitHub repositories. Provides intelligent file watching, tag-based organization, and full-text search capabilities.
Features
✨ Dual Source Support
Read from local filesystem directories
Fetch from GitHub repositories (public and private)
🔍 File Watching
Automatic detection of file changes (add, modify, delete)
Real-time metadata and index updates
Efficient monitoring with minimal overhead
🏷️ Smart Tagging & Categorization
Extract tags from YAML frontmatter
Parse inline hashtags from content
Fast tag-based file discovery
Metadata extraction (title, description, tags)
🔎 Full-Text Search
Search across all context files
Relevance-based ranking
Filter by tags and sources
Context snippets in results
🚀 Optimized Performance
Intelligent caching
Incremental updates
Support for large repositories
Related MCP server: membot
Installation
Prerequisites
Node.js 18+
npm or yarn
Setup
Clone or download the service:
mkdir context-file-mcp
cd context-file-mcpInstall dependencies:
npm install @modelcontextprotocol/sdk@^0.5.0 @octokit/rest@^20.0.0 chokidar@^3.5.3Create package.json:
{
"name": "context-file-mcp",
"version": "2.0.0",
"type": "module",
"bin": {
"context-file-mcp": "./index.ts"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^0.5.0",
"@octokit/rest": "^20.0.0",
"chokidar": "^3.5.3"
}
}Save the service code as
index.tsMake it executable:
chmod +x index.tsConfiguration
For Claude Desktop
Add to your claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"context-files": {
"command": "node",
"args": ["/absolute/path/to/context-file-mcp/index.ts"]
}
}
}For Claude Code
Add to your MCP settings:
macOS/Linux: ~/.config/claude-code/mcp_settings.json
Windows: %APPDATA%\claude-code\mcp_settings.json
{
"mcpServers": {
"context-files": {
"command": "node",
"args": ["/absolute/path/to/context-file-mcp/index.ts"]
}
}
}Usage
Adding Sources
Local Directory:
Add a local source called 'project-docs' from /Users/me/project/docs with watching enabledGitHub Repository:
Add a GitHub source called 'team-context' from owner 'mycompany' repo 'ai-context' path 'docs' with token 'ghp_...'Managing Context Files
List Sources:
Show me all configured sourcesList Files:
List all context files in 'project-docs'Read Files:
Read the authentication.md context file from 'project-docs'Read Multiple Files:
Read these context files from 'project-docs': authentication.md, database.md, api-guidelines.mdSearch & Discovery
Full-Text Search:
Search for 'authentication flow' in my context filesSearch with Tag Filter:
Search for 'database' in files tagged 'backend'List All Tags:
Show me all available tagsFind by Tag:
Show me all context files tagged 'api'Get Metadata:
What are the tags and description for api-guidelines.md in 'project-docs'?Maintenance
Refresh File List:
Refresh the file list for 'project-docs'Stop Watching:
Stop watching 'project-docs' for changesContext File Format
Create context files with YAML frontmatter for optimal organization:
---
title: Authentication Guide
description: OAuth2 and JWT implementation guidelines
tags: [auth, security, api, backend]
---
# Authentication Guide
This guide covers our authentication approach using OAuth2 and JWT.
## OAuth2 Flow
Use #oauth2 for third-party authentication...
## JWT Tokens
Implement #jwt for session management...Supported Formats
Frontmatter tags:
tags: [tag1, tag2, tag3]Array format:
tags: - tag1 - tag2Inline hashtags:
#tag1 #tag2within content
File Extensions
The service automatically detects these file types:
.md- Markdown files.mdx- MDX files.txt- Plain text files.context- Context-specific files
API Reference
Tools
add_source
Add a new context file source.
Parameters:
name(string, required): Identifier for the sourcetype(string, required):"local"or"github"path(string, required): Directory path or GitHub repo pathwatch(boolean, optional): Enable file watching (local only)githubToken(string, optional): GitHub PAT for private reposowner(string, required for GitHub): Repository ownerrepo(string, required for GitHub): Repository namebranch(string, optional): Branch name (default: "main")
list_sources
List all configured sources.
list_files
List files in a source.
Parameters:
source(string, required): Source name
read_context_file
Read a single context file.
Parameters:
source(string, required): Source namefile(string, required): File path
read_multiple_context_files
Read multiple context files.
Parameters:
source(string, required): Source namefiles(array, required): Array of file paths
search_context_files
Search across context files.
Parameters:
query(string, required): Search querytags(array, optional): Filter by tagssource(string, optional): Limit to specific source
list_tags
List all available tags.
get_files_by_tag
Get files with a specific tag.
Parameters:
tag(string, required): Tag name
get_file_metadata
Get metadata for a file.
Parameters:
source(string, required): Source namefile(string, required): File path
refresh_file_list
Force refresh file cache.
Parameters:
source(string, required): Source name
stop_watching
Stop watching a source.
Parameters:
source(string, required): Source name
Resources
Context files are exposed as MCP resources with URIs:
context://<source-name>/<file-path>Example: context://project-docs/auth/oauth2.md
Resources include metadata:
tags: Array of tagstitle: File title (from frontmatter)description: File description (from frontmatter)
GitHub Authentication
For private repositories, create a GitHub Personal Access Token (PAT):
Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
Generate new token with
reposcopeUse the token when adding a GitHub source
Security Note: Store tokens securely. Consider using environment variables:
{
"mcpServers": {
"context-files": {
"command": "node",
"args": ["/path/to/index.ts"],
"env": {
"GITHUB_TOKEN": "ghp_..."
}
}
}
}Then modify the service to read from process.env.GITHUB_TOKEN.
Use Cases
Documentation Assistant
Keep all project documentation in context for accurate answers:
"Using the API guidelines and authentication docs, help me implement a new endpoint"Coding Standards Enforcement
Reference style guides and best practices:
"Review this code against our coding standards in 'standards/typescript.md'"Knowledge Base
Build a searchable knowledge base:
"Search for 'deployment pipeline' across all documentation"Multi-Project Context
Manage contexts for multiple projects:
Add local source 'project-a-docs' from /projects/a/docs
Add local source 'project-b-docs' from /projects/b/docsTeam Collaboration
Share context via GitHub:
Add GitHub source 'team-kb' from owner 'company' repo 'knowledge-base' path 'context'Troubleshooting
Files Not Appearing
Check file extensions: Only
.md,.txt,.context, and.mdxfiles are indexedVerify path: Ensure the path is absolute and accessible
Refresh cache: Use
refresh_file_listto force update
File Watching Not Working
Local sources only: File watching only works for local directories
Enable watching: Ensure
watch: truewhen adding sourceCheck permissions: Verify read access to the directory
GitHub Connection Issues
Check token: Ensure PAT has
reposcopeVerify repository: Confirm owner and repo names
Branch name: Default is "main", specify if different
Rate limits: GitHub API has rate limits; consider caching
Search Not Finding Files
Refresh source: Run
refresh_file_listto update indexesCheck tags: Ensure files have proper frontmatter
Case sensitivity: Searches are case-insensitive but check spelling
Performance Tips
Enable caching: File lists and metadata are cached automatically
Use file watching: Avoid manual refreshes with automatic updates
Tag organization: Well-tagged files improve search performance
Limit scope: Search specific sources when possible
GitHub rate limits: Cache aggressively for GitHub sources
Contributing
Contributions are welcome! Areas for improvement:
Additional metadata extraction
Custom file type support
Advanced search operators
Workspace integration
Export/import configurations
License
MIT License - feel free to use and modify as needed.
Support
For issues and questions:
Check the troubleshooting section
Review Claude's MCP documentation: https://docs.claude.com
File issues on your repository
Version History
v2.0.0
Added file watching with chokidar
Implemented tag indexing and categorization
Added full-text search with relevance ranking
Metadata extraction from frontmatter
Enhanced error handling
v1.0.0
Initial release
Local and GitHub source support
Basic file reading
MCP tools and resources integration
Available Tools
9 toolsadd_sourceB
Add a context file source (local directory or GitHub repository)
Inputs: name (required), path (required), type (required), repo, +4 more.
get_file_metadataB
Get metadata (tags, title, description) for a context file
Inputs: file (required), source (required).
get_files_by_tagB
Get all context files with a specific tag
Inputs: tag (required).
list_filesB
List all context files available in a source
Inputs: source (required).
list_sourcesA
List all configured context file sources
Inputs: no named parameters.
read_context_fileB
Read the contents of a specific context file
Inputs: file (required), source (required).
read_multiple_context_filesC
Read multiple context files at once
Inputs: files (required), source (required).
refresh_file_listB
Refresh the cached list of files for a source
Inputs: source (required).
search_context_filesC
Search across context files with optional tag filtering
Inputs: query (required), tags, source.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Each tool has a clearly distinct purpose: listing, reading (single and multiple), searching, retrieving by tag, fetching metadata, refreshing cache, and managing sources. No overlapping functionalities that would cause misselection.
All tool names follow a consistent verb_noun pattern using snake_case (e.g., list_files, read_context_file, add_source). The naming convention is uniform and predictable across all 9 tools.
With 9 tools, the set is well-scoped for a context file management service. Each tool covers a necessary operation without redundancy or excessive granularity.
The tool surface covers the full lifecycle for context files: browsing sources, listing files, reading content (single and batch), searching/tagging, retrieving metadata, and refreshing cache. No obvious gaps for the intended read-oriented purpose.
Maintenance
Related MCP Connectors
Securely search and manage workspace context files for AI agents and teams.
Personal context for every AI: search, read, and write back to your private Markdown library.
Intelligent context infrastructure for AI teams: knowledge graph, sessions, tasks, documents.
Shared project context for AI agents and teams: docs, tasks, and messages that stay current.
Related MCP Servers
- AlicenseBqualityCmaintenanceProvides context management and todo persistence with AI second opinions from ChatGPT and Claude. Enables saving code snippets, conversations, and todos across sessions with full-text search capabilities.34MIT
- AlicenseNot gradedqualityCmaintenanceProvides a persistent, versioned, and searchable context store for AI agents with local embedding and hybrid search.42 npm3MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI coding assistants to store and retrieve project-aware context as plain Markdown files locally, with no cloud or vector database required.1MIT

whimsicality-dbofficial
AlicenseNot gradedqualityDmaintenanceEnables persistent, full-text-searchable context for AI agents, including session tracking, event logging, todo management, and tagged context retrieval.5 npm1MIT