Unified context layer connecting local data to LLMs via MCP
Project description
Context Bridge
A unified context layer that connects your local data — repositories, documents, remote machines, and notes — to LLM interfaces through the Model Context Protocol (MCP).
Installation • Configuration • Connectors • Contributing
The Problem
Modern LLMs are powerful but context-starved. They don't know about:
- Your local codebase structure and recent changes
- Your Obsidian notes and personal knowledge base
- Your remote servers and their configurations
- Your project's documentation and dependencies
- Your PostgreSQL database schemas and query history
- Your Docker container logs and running services
You end up copy-pasting snippets or trying to explain complex contexts in a chat window.
The Solution
Context Bridge runs locally, reads your data sources, and exposes them to any MCP-compatible LLM client (Claude Desktop, Cursor, Continue, Aether, etc.). It handles authentication, caching, chunking, and real-time updates so the LLM always has relevant context.
Installation
From PyPI (recommended)
pip install context-bridge
From Source
git clone https://github.com/Codinglone/context-bridge.git
cd context-bridge
make install
Quick Start
# Generate a starter config
context-bridge init ~/.config/context-bridge/config.yaml
# Set your GitHub token (optional, for GitHub connector)
export GITHUB_TOKEN="ghp_..."
# Start the MCP server (stdio mode for Claude Desktop)
context-bridge serve
# Or start in HTTP mode for browser extension support
context-bridge serve --transport http
Why Context Bridge?
What you do today
| Want LLM to see... | Your workflow right now |
|---|---|
| Local code | Copy-paste files, or hope the editor's index is current |
| GitHub PR + issues | Open browser, copy links, paste context |
| Obsidian notes | Export to text, paste into chat |
| PostgreSQL schema | Run \d in psql, copy output |
| Docker logs | docker logs ..., copy-paste |
| Remote server files | SSH, cat, copy-paste |
Each source is a separate manual step. Ten minutes later the LLM still might miss that the DB migration in PR #42 changed a column name.
What Context Bridge enables
One MCP server exposes structured tools for every source. The LLM can query across boundaries in a single conversation turn:
You: "Why is my deploy failing?"
LLM calls:
docker.get_logs("api-container") → sees the error
github.get_pr("my-app", 42) → sees the migration
pg.get_schema("users") → confirms the column rename
obsidian.get_note("deploy runbook") → finds your troubleshooting notes
fs.read_file("src/db/migrations/042_*.sql") → reads the actual migration
The LLM gets the same situational awareness you have when sitting at your terminal — without you copy-pasting anything.
Key advantages
- Unified toolset — One server, all sources. No context switching between browser, terminal, and chat.
- Real-time sync — File watchers push updates within seconds. No stale indexes.
- Structured tools —
obsidian.get_backlinks("Next Steps")returns your link graph.pg.get_schema("users")returns column types + constraints. Way better than raw text dumps. - Privacy-first — SSH keys, DB passwords, vault contents stay local. Only the data you choose goes to the LLM.
- Pluggable — Need a new source? Write one connector. The rest of the system doesn't change.
Key Features
- Filesystem Connector: Watch local directories, respect
.gitignore, provide file contents and tree structure - GitHub Connector: Fetch repository code, issues, PRs, and discussions via API
- SSH Connector: Execute commands and read files on remote VMs/servers
- Obsidian Connector: Index your vault, follow wiki-links, search by tags and backlinks
- PostgreSQL Connector: Introspect schemas, list tables, view recent query history
- Docker Connector: Inspect running containers, stream logs, view service status
- MCP Server: Standard MCP protocol — works with any compatible client
- Smart Chunking: RAG-style retrieval so you don't burn context windows on irrelevant data
- Real-time Sync: File watchers push updates to connected clients automatically
Configuration
Context Bridge reads from ~/.config/context-bridge/config.yaml. Create it with:
context-bridge init ~/.config/context-bridge/config.yaml
Minimal Example
server:
transport: stdio # stdio for Claude Desktop; http for remote
port: 8080
connectors:
filesystem:
- path: ~/projects
name: projects
exclude: [node_modules, .git, __pycache__]
github:
token: ${GITHUB_TOKEN}
repos: ["owner/repo"]
cache_ttl: 300
obsidian:
vault: ~/Documents/Obsidian Vault
exclude: [.git, attachments, .trash]
docker:
socket: unix:///var/run/docker.sock
Filesystem Connector
Watch local directories with file change detection:
connectors:
filesystem:
- path: ~/projects
name: projects
exclude: [node_modules, .git, __pycache__, .venv, target, dist, build]
max_file_size: 1048576 # 1 MB
path: Directory to watchname: Alias used in tool callsexclude: Patterns to ignoremax_file_size: Reject files larger than this (bytes)
GitHub Connector
Access public and private repositories via the GitHub API:
connectors:
github:
token: ${GITHUB_TOKEN}
repos:
- owner/repo
- owner/another-repo
cache_ttl: 300 # seconds
Token setup:
- Go to
https://github.com/settings/tokens - Generate a Classic token with
reposcope - Export it:
export GITHUB_TOKEN="ghp_..."
SSH Connector
Execute commands and read files on remote servers:
connectors:
ssh:
- host: prod-server
user: deploy
port: 22
key: ~/.ssh/id_rsa
host: Alias or hostnameuser: SSH usernameport: SSH port (default 22)key: Path to private key (uses SSH agent if omitted)
Tools exposed:
ssh.run_command("prod-server", "df -h")ssh.read_file("prod-server", "/var/log/syslog")ssh.list_dir("prod-server", "/etc")
PostgreSQL Connector
Introspect schemas and run read-only queries:
connectors:
postgresql:
- name: local-dev
connection_string: postgresql://user:pass@localhost:5432/mydb
schemas: [public]
query_timeout: 30
# ssh_tunnel: bastion # Optional: tunnel through SSH host
Connection string formats:
- URL:
postgresql://user:pass@host:5432/dbname - Key-value:
host=localhost port=5432 dbname=mydb user=postgres password=secret
SSH Tunnel for remote databases:
If your database is behind a bastion host, add the SSH host first, then reference it:
connectors:
ssh:
- host: bastion
user: admin
port: 22
key: ~/.ssh/id_rsa
postgresql:
- name: remote-db
connection_string: postgresql://dbuser:dbpass@db.internal:5432/app
schemas: [public]
query_timeout: 30
ssh_tunnel: bastion # References the SSH host above
Context Bridge will:
- Open an SSH connection to the bastion
- Create a local port forward
- Rewrite the connection string to use
127.0.0.1:<random_port> - Connect PostgreSQL through the tunnel
Tools exposed:
pg.list_tables("local-dev", "public")pg.get_schema("local-dev", "public", "users")pg.get_indexes("local-dev", "public", "users")pg.get_foreign_keys("local-dev", "public", "users")pg.run_query("local-dev", "SELECT * FROM users LIMIT 5")
Obsidian Connector
Index and query your Obsidian vault:
connectors:
obsidian:
vault: ~/Documents/Obsidian Vault
exclude: [.git, attachments, .trash]
Features:
- Full-text search across all notes
- Wiki-link graph traversal (
[[Note Title]]) - Tag extraction (
#tag) - Backlink discovery
- Frontmatter parsing
- Real-time re-indexing on file changes
Tools exposed:
obsidian.search("deploy")obsidian.get_note("Next Steps")obsidian.get_backlinks("Context Bridge")obsidian.get_tags()
Docker Connector
Inspect running containers:
connectors:
docker:
socket: unix:///var/run/docker.sock
include_stopped: false
max_log_lines: 500
Tools exposed:
docker.list_containers()docker.get_logs("api-container", tail=100)docker.inspect("api-container")docker.list_services()# Docker Compose projects
Connecting to Claude Desktop
Add to Claude Desktop's MCP config (~/.config/claude-desktop/config.json):
{
"mcpServers": {
"context-bridge": {
"command": "/home/codinglone/Documents/projects/context-bridge/.venv/bin/python",
"args": ["-m", "context_bridge.cli", "serve"]
}
}
}
Restart Claude Desktop. The LLM will now see all your configured tools.
Web-Based Chatbots (ChatGPT, Claude Web, etc.)
Web-based chatbots don't support MCP natively — they run in a browser sandbox with no access to your local filesystem. Context Bridge provides three integration paths:
Option 1: Browser Extension (Recommended)
A Chrome extension is included in extensions/chrome/.
Installation:
# 1. Start Context Bridge in HTTP mode
context-bridge serve --transport http
# 2. Load the extension
# Open Chrome → chrome://extensions/ → Enable Developer Mode → Load Unpacked
# Select: extensions/chrome/
Features:
- @context trigger button appears on ChatGPT, Claude, and Poe pages
- Browse all connectors and tools in a searchable modal
- Execute tools with arguments
- Insert results directly into the chat input or copy to clipboard
- Extension popup for quick tool access from the toolbar
Architecture:
Browser Extension → localhost:8080 → Context Bridge → Your Data
↓
Injects context into ChatGPT/Claude/Poe web UI
Option 2: HTTP Server + Manual Copy-Paste
For quick testing without installing the extension:
context-bridge serve --transport http
# Open http://localhost:8080 in browser
# Click tools, copy results, paste into chat
Option 3: Aether Native Integration
Since you have an aether repo, integrate Context Bridge directly into your own AI interface:
from context_bridge.server import ContextBridgeServer
from context_bridge.config import ContextBridgeConfig
config = ContextBridgeConfig.from_yaml("config.yaml")
server = ContextBridgeServer(config)
await server.router.initialize_all()
# In your chat handler:
result = await server.router.call_tool("github.get_file", {
"repo": "Codinglone/aether",
"path": "src/main.py"
})
# Feed result.context into your LLM prompt
This gives you full control — no browser sandbox, no copy-paste, no extensions.
Option 4: Proxy Bridge (Advanced)
Run Context Bridge as a proxy between the web chatbot's API and your data:
User → Web Chatbot API (OpenAI/Anthropic)
↓
Context Bridge intercepts the prompt
↓
Injects relevant context from fs/github/obsidian/etc.
↓
Forwards enriched prompt to LLM
↓
Returns response to user
This requires building a middleware layer but gives fully automatic context injection.
Status
All 6 connectors implemented with real-world integration tests. See docs/DESIGN.md and docs/ARCHITECTURE.md for design docs.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_context_bridge-0.1.0.tar.gz.
File metadata
- Download URL: mcp_context_bridge-0.1.0.tar.gz
- Upload date:
- Size: 57.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5df274287953a1b0c1183df46305207b433c66e41930469e237ae06f62841bc2
|
|
| MD5 |
0811ea18529a311cd4e1f61856c44309
|
|
| BLAKE2b-256 |
ac60564407b4be7b7f95bf9f13e6729dc06b69d58a542f737c9518d1970b677d
|
File details
Details for the file mcp_context_bridge-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_context_bridge-0.1.0-py3-none-any.whl
- Upload date:
- Size: 33.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da660011edefd65cbefe2ed1a42af5071258c4cdfe4430409be3b9a8d2620b7b
|
|
| MD5 |
45ebfaeadb4273d1bdc4b37d84bf554d
|
|
| BLAKE2b-256 |
f09a1f64bf0ce379fe315a5c24eb34f8f2bfe3ed332f0d0aba9412a895fa8cb5
|