ContextForge MCP Lab
A local MCP-style server for managing task records and seeded documents through controlled tool functions, using SQLite and JSON seed data.
README
ContextForge MCP Lab
Overview
ContextForge MCP Lab is a local MCP-style data access server for working with task records and seeded documents through controlled tool functions. It uses Python, SQLite, JSON seed manifests, and sample text files to model how an AI-facing tool layer can expose useful application actions without exposing unrestricted database access.
The project is intentionally small: it provides a reproducible local database, a command-line tool dispatcher, and tests around the task and document workflows.
Features
- MCP-style named tool interface
- SQLite database with
tasksanddocumentstables - JSON-based seed data for repeatable local setup
- Seeded sample documents loaded from text files
- Controlled task and document functions
- Input validation for IDs, statuses, search terms, titles, and descriptions
- Parameterized SQLite queries
- Configurable database path through
.env - Pytest coverage for database setup, seed loading, tool behavior, validation, and unknown tool rejection
Architecture
ContextForge MCP Lab is organized into a small set of layers:
- MCP-style tool interface:
src/server.pydispatches named JSON-compatible tool calls, andsrc/tools.pyexposes the registered task and document functions. - Python service layer: tool functions validate the callable surface and delegate workflow-specific behavior to the database module.
- SQLite persistence layer:
src/database.pyowns schema creation, reads, writes, updates, deletes, and search queries. - Seeded sample files:
data/*.jsondefines seed metadata, whilesample_files/*.txtprovides document bodies. - Tests:
tests/verifies database initialization, seed behavior, tool calls, validation, and rejection of unregistered tools.
Tools
Task functions:
create_task(title, description, status="todo")list_tasks(status=None)search_tasks(query)complete_task(task_id)delete_task(task_id)
Document functions:
list_documents()search_documents(query)get_document(document_id)summarize_document_metadata()
Data Model
The tasks table stores local task records:
id: auto-incrementing integer primary keytitle: required task titledescription: required task descriptionstatus: one oftodo,in_progress, ordonecreated_at: UTC timestampcompleted_at: UTC timestamp set when a task is completed
The documents table stores seeded document metadata and content:
id: auto-incrementing integer primary keyfilename: unique source filenametitle: document titlecategory: document categorysummary: short document summarycontent: full text loaded fromsample_files/created_at: UTC timestamp
Installation
cd contextforge-mcp-lab
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Optional environment setup:
cp .env.example .env
The default database path is data/contextforge.db.
Seeding the Demo Database
python -m src.seed_data
This rebuilds the demo database with five task records and five documents loaded from sample_files/.
Running Tests
python -m pytest
Example Usage
Call tools through the local command dispatcher:
python -m src.server list_tasks
python -m src.server search_documents --args '{"query": "maintenance"}'
python -m src.server create_task --args '{"title": "Capture demo screenshot", "description": "Save terminal output showing seeded data and passing tests."}'
python -m src.server complete_task --args '{"task_id": 1}'
The same functions can be called directly from Python:
from src.server import call_tool
tasks = call_tool("list_tasks")
matches = call_tool("search_documents", {"query": "policy"})
task = call_tool(
"create_task",
{
"title": "Review document metadata",
"description": "Check seeded document categories and summaries.",
},
)
completed = call_tool("complete_task", {"task_id": task["id"]})
Security Notes
- There is no raw SQL tool.
- Callers can only use registered task and document functions.
- SQLite access uses parameterized queries.
- Input validation is applied before database operations.
- The repository contains demo data only.
- The sample files are fictional and do not contain personal data.
Project Structure
contextforge-mcp-lab/
README.md
SETUP.md
PORTFOLIO_WRITEUP.md
LICENSE
requirements.txt
pyproject.toml
src/
server.py
database.py
tools.py
config.py
seed_data.py
tests/
test_database.py
test_tools.py
docs/
ARCHITECTURE.md
DEMO_PLAN.md
sample_files/
marketing_campaign_notes.txt
server_maintenance_log.txt
customer_support_policy.txt
research_brief_llm_evals.txt
project_meeting_summary.txt
data/
sample_tasks.json
sample_documents.json
Roadmap
- Real MCP client integration
- FastAPI demo layer
- Rate limiting for hosted demo endpoints
- GitHub Actions test workflow
- Containerized deployment
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.