
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
context-engine-dev
Advanced tools
Context Engine MCP Server - Persistent memory and context management for AI coding tools
"Git for AI Conversations" - An intelligent Model Context Protocol (MCP) server that provides smart project context management and persistent memory for AI coding tools.
Status: PRODUCTION READY Version: Phase 1 Complete Server: Live and Running Database: Connected Repository: https://github.com/gurram46/Context_Engine_MCP.git
Project Contexts (Persistent)
├── Tech Stack Detection
├── Project Metadata
└── Cross-Session Memory
Sessions (Temporary)
├── Session History
├── File Collections
└── Conversations
Conversations (Current)
├── AI Tool Messages
├── User Messages
└── Context State
git clone https://github.com/gurram46/Context_Engine_MCP.git
cd context-engine-mcp
npm install
cp .env.example .env
# Edit .env with your database credentials
-- Create database (run in PostgreSQL)
CREATE DATABASE context_engine_MCP;
-- Create user (optional, if not using default postgres user)
CREATE USER context_engine_user WITH PASSWORD 'your_password';
GRANT ALL PRIVILEGES ON DATABASE context_engine_MCP TO context_engine_user;
npm run db:migrate
npm run typecheck # Should pass with no errors
npm run build # Build for production
# Issue a token (only shows once)
npx context-engine-token generate
# Write Claude/Cursor/Codex configs pointing at your server
npx context-engine-setup --token=ce-XXXX --url=https://context-engine.quantumworks.services --tools=claude,cursor,codex
Run the setup command once per machine (or whenever you rotate tokens); the generated config files live in your user profile and apply to every project.
# Start a local proxy that forwards stdio to the hosted HTTP MCP server
CONTEXT_ENGINE_TOKEN=ce-XXXX \
CONTEXT_ENGINE_URL=https://context-engine.quantumworks.services \
npx --yes --package context-engine-dev@latest context-engine-proxy
Configure Warp, Kilocode, or any stdio-only MCP client to run the proxy command above. It keeps stdio compatibility while forwarding requests to the hosted HTTP transport.
cd "C:\Users\sande\context-engine-MCP"
npx tsx test-server.ts
cd "C:\Users\sande\context-engine-MCP"
npm run build
npm start
cd "C:\Users\sande\context-engine-MCP"
npm run dev
postman-collection.json into Postmanhttp://localhost:8090# Run comprehensive test suite
npm test
# Smart context management tests
npx tsx test-smart-context.ts
# Type checking
npm run typecheck
# Build validation
npm run build
# Health check
curl http://localhost:8090/health
# Server information
curl http://localhost:8090/info
# Available tools
curl http://localhost:8090/tools
http://localhost:8090| Endpoint | Description | Response |
|---|---|---|
/health | Server health check | Health status and database info |
/info | Server configuration | Features, version, uptime |
/tools | Available MCP tools | Tool definitions and methods |
| Endpoint | Description | Input | Response |
|---|---|---|---|
/tools/context.save | Save session | Session data | Success/error response |
/tools/context.resume | Resume session | Search criteria | Session data or matches |
/tools/context.list | List sessions | Filters | Paginated results |
await context.save({
session_name: "my-project-session",
project_name: "web-app",
files: [
{
path: "src/index.ts",
content: "console.log('Hello World');"
}
],
conversation: [
{
role: "user",
content: "Create a TypeScript project"
}
],
metadata: {
tags: ["typescript", "demo"],
description: "Initial project setup"
}
});
// Exact match
const session = await context.resume({
session_name: "my-project-session",
project_name: "web-app"
});
// Fuzzy search
const matches = await context.resume({
session_name: "project"
});
const sessions = await context.list({
project_name: "web-app",
limit: 20,
offset: 0
});
{
"mcpServers": {
"context-engine": {
"command": "npx tsx src/index.ts",
"args": []
}
}
}
{
"mcp": {
"servers": {
"context-engine": {
"command": "npm run dev"
}
}
}
}
{
"mcpServers": [
{
"name": "context-engine",
"command": "npx tsx src/index.ts"
}
]
}
-- Users table
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id VARCHAR(255) UNIQUE NOT NULL,
email VARCHAR(255) UNIQUE,
metadata JSONB DEFAULT '{}',
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- Project contexts table (NEW)
CREATE TABLE project_contexts (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES users(id),
project_name VARCHAR(100) NOT NULL,
description TEXT,
tech_stack JSONB DEFAULT '{}',
project_type VARCHAR(50),
programming_languages JSONB DEFAULT '[]',
build_system VARCHAR(50),
test_framework VARCHAR(50),
git_url TEXT,
first_seen_at TIMESTAMPTZ DEFAULT NOW(),
last_modified_at TIMESTAMPTZ DEFAULT NOW(),
is_active BOOLEAN DEFAULT true,
context_hash VARCHAR(64)
);
-- Sessions table (Updated for 3-layer context)
CREATE TABLE sessions (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID REFERENCES users(id),
project_context_id UUID REFERENCES project_contexts(id),
name VARCHAR(100) NOT NULL,
project_name VARCHAR(100) NOT NULL,
version INTEGER NOT NULL DEFAULT 1,
metadata JSONB DEFAULT '{}',
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
-- Files table
CREATE TABLE files (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
session_id UUID NOT NULL REFERENCES sessions(id) ON DELETE CASCADE,
path VARCHAR(500) NOT NULL,
content TEXT,
content_hash VARCHAR(64),
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- Conversations table
CREATE TABLE conversations (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
session_id UUID NOT NULL REFERENCES sessions(id) ON DELETE CASCADE,
role VARCHAR(20) NOT NULL,
content TEXT NOT NULL,
sequence INTEGER NOT NULL,
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- Summaries table
CREATE TABLE summaries (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
session_id UUID NOT NULL REFERENCES sessions(id) ON DELETE CASCADE,
version INTEGER NOT NULL,
summary TEXT,
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- GIN indexes for fuzzy search
CREATE INDEX idx_sessions_name_gin ON sessions USING gin(name gin_trgm_ops);
CREATE INDEX idx_files_path_gin ON files USING gin(path gin_trgm_ops);
-- B-tree indexes for lookups
CREATE INDEX idx_sessions_project ON sessions(project_name);
CREATE INDEX idx_sessions_user ON sessions(user_id);
CREATE INDEX idx_files_session ON files(session_id);
CREATE INDEX idx_conversations_session ON conversations(session_id);
# Database Configuration
DATABASE_URL=postgresql://postgres:2003@localhost:5432/context_engine_MCP
DATABASE_POOL_SIZE=20
DATABASE_TIMEOUT=30000
DATABASE_SSL_CA_FILE=certs/railway-ca.crt
DATABASE_SSL_CHECK_HOSTNAME=false
# Server Configuration
MCP_SERVER_PORT=8090
MCP_SERVER_HOST=localhost
NODE_ENV=development
LOG_LEVEL=info
MCP_SERVER_HTTPS_ENABLED=false
MCP_SERVER_HTTPS_KEY_PATH=./certs/server.key
MCP_SERVER_HTTPS_CERT_PATH=./certs/server.crt
MCP_SERVER_TRUST_PROXY=false
MCP_SERVER_TRUST_PROXY_IPS=
RATE_LIMIT_WINDOW_MS=60000
RATE_LIMIT_MAX_REQUESTS=100
### HTTPS & Proxy Configuration
- `MCP_SERVER_HTTPS_ENABLED`: Enable HTTPS termination inside the MCP server. Provide PEM-encoded files via `MCP_SERVER_HTTPS_KEY_PATH` and `MCP_SERVER_HTTPS_CERT_PATH`.
- `MCP_SERVER_TRUST_PROXY`: Only set to `true` when the server is deployed behind a trusted reverse proxy. Optionally supply a comma-separated allow list in `MCP_SERVER_TRUST_PROXY_IPS` for additional safety.
- `DATABASE_SSL_CA_FILE`: Path to the PostgreSQL CA bundle. Required when your provider (e.g., Railway) issues self-signed certificates.
- `DATABASE_SSL_CHECK_HOSTNAME`: Set to `false` when your provider presents certificates with a `localhost` CN (Railway). Keeps TLS enabled while skipping the hostname check.
### Rate Limiting
- When `ENABLE_RATE_LIMITING=true`, the server enforces an in-memory limiter (default: 100 requests per 60s window) on feedback endpoints. Adjust `RATE_LIMIT_WINDOW_MS` and `RATE_LIMIT_MAX_REQUESTS` to tune behaviour.
> ℹ️ **Secret management:** keep real credentials (database URLs, TLS keys, API tokens) out of the repository. Use deployment-specific secret stores or environment injection instead of checking sensitive values into `.env` files.
# MCP Protocol Configuration
MCP_PROTOCOL_TRANSPORT=stdio
MCP_PROTOCOL_VERSION=2025-06-18
# Feature Flags
ENABLE_SESSION_VERSIONING=true
ENABLE_FUZZY_MATCHING=true
ENABLE_FILE_VALIDATION=true
ENABLE_AUTO_SUMMARIZATION=true
ENABLE_INPUT_VALIDATION=true
ENABLE_RATE_LIMITING=false
## Setup for Claude Code / Codex (Local Bridge)
1. Install the bridge CLI globally:
```bash
npm install -g context-engine-dev@latest
claude_desktop_config.json):
{
"mcpServers": {
"context-engine": {
"command": "context-engine-bridge",
"env": {
"CONTEXT_ENGINE_URL": "https://context-engine.quantumworks.services",
"CONTEXT_ENGINE_TOKEN": "ce-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
}
save this as bridge-test
Resume with:
resume bridge-test
CONTEXT_ENGINE_TOKEN is configured or exported before running the bridge.https://context-engine.quantumworks.services.MAX_FILE_SIZE_KB=1000 MAX_SESSION_TOKENS=50000 MAX_CONCURRENT_OPERATIONS=100
### **Feature Flags**
| Flag | Description | Default |
|------|-------------|---------|
| `ENABLE_SESSION_VERSIONING` | Auto-version sessions on save | `true` |
| `ENABLE_FUZZY_MATCHING` | Enable fuzzy search for resuming | `true` |
| `ENABLE_FILE_VALIDATION` | Validate file paths and sizes | `true` |
| `ENABLE_AUTO_SUMMARIZATION` | Auto-summarize old sessions | `true` |
---
## 🔍 Smart Context Detection
### **Automatic Tech Stack Detection**
```typescript
// Detected from package.json, tsconfig.json, etc.
{
"tech_stack": {
"npm_packages": ["express", "react", "typescript"],
"framework": "Express.js",
"ui_library": "React",
"build_tool": "Webpack"
},
"project_type": "full-stack-web",
"programming_languages": ["javascript", "typescript", "jsx", "tsx"],
"build_system": "npm",
"test_framework": "jest"
}
# Type checking
npm run typecheck
# Linting (if configured)
npm run lint
# Build validation
npm run build
# Test coverage
npm run test:coverage
# Run migrations
npm run db:migrate
# Reset database (development only)
npm run db:reset
# Seed test data
npm run db:seed
# Development with hot reload
npm run dev
# Verbose logging
LOG_LEVEL=debug npm run dev
# Database query logging
DB_DEBUG=true npm run dev
curl http://localhost:8090/health
Response:
{
"status": "healthy",
"details": {
"queryTime": "5ms",
"timestamp": "2025-01-28T16:56:33.157Z",
"version": "PostgreSQL 17.0...",
"poolStats": {
"totalCount": 1,
"idleCount": 1,
"waitingCount": 0
}
}
}
curl http://localhost:8090/info
curl http://localhost:8090/tools
-- Table sizes
SELECT
schemaname,
tablename,
pg_size_pretty(pg_total_relation_size(tablename::oid) AS size
FROM pg_tables
WHERE schemaname = 'public'
ORDER BY pg_total_relation_size(tablename::oid) DESC;
{
"code": "VALIDATION_ERROR",
"message": "Invalid input provided",
"details": {
"errors": [
{
"field": "session_name",
"message": "Session name is required and must be 1-100 characters"
}
]
},
"alternatives": ["Try a different session name", "Check format requirements"]
}
# Kill existing Node.js processes
taskkill /F /IM node.exe
# Or find specific PIDs
netstat -ano | findstr ":8090"
# Check PostgreSQL service
# Windows: Services.msc
# macOS: brew services list
# Linux: systemctl status postgresql
# Test connection
psql -h localhost -U postgres -d context_engine_MCP
# Check database permissions
GRANT ALL PRIVILEGES ON DATABASE context_engine_MCP TO postgres;
# Re-run migrations
npm run db:migrate
# Development with hot reload
npm run dev
# Production build
npm run build
# Start production server
npm start
# Type checking
npm run typecheck
# Database migrations
npm run db:migrate
# Testing
npm test
npm run test:coverage
# Linting
npm run lint
npm run lint:fix
# Reset all data (development only)
npm run db:reset
# Generate API documentation
npm run docs:generate
# Performance testing
npm run test:performance
# Security audit
npm audit
npm audit fix
{
"scripts": {
"dev": "tsx watch src/index.ts",
"build": "tsc",
"start": "node dist/index.js",
"typecheck": "tsc --noEmit",
"test": "vitest",
"test:watch": "vitest --watch",
"test:coverage": "vitest --coverage",
"db:migrate": "tsx src/database/migrate.ts",
"db:seed": "tsx src/database/seed.ts",
"db:reset": "tsx src/database/reset.ts",
"lint": "eslint src --ext .ts",
"lint:fix": "eslint src --ext .ts --fix"
}
}
git checkout -b feature/your-featurenpm run typecheck && npm testbehavioral OS/AGENTS.mdMIT License - see LICENSE file for details.
/health endpointUnlike traditional session storage, the Context Engine organizes conversations by project, providing:
The Context Engine MCP Server is 100% complete and production-ready!
🚀 Start Using It Today:
Your AI coding tools will now have persistent memory and intelligent project context management! 🚀
Built with ❤️ for the AI development community Repository: https://github.com/gurram46/Context_Engine_MCP.git License: MIT License
FAQs
Context Engine MCP Server - Persistent memory and context management for AI coding tools
We found that context-engine-dev demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.