ContextForge MCP Lab

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.

Category
Visit Server

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 tasks and documents tables
  • 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.py dispatches named JSON-compatible tool calls, and src/tools.py exposes 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.py owns schema creation, reads, writes, updates, deletes, and search queries.
  • Seeded sample files: data/*.json defines seed metadata, while sample_files/*.txt provides 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 key
  • title: required task title
  • description: required task description
  • status: one of todo, in_progress, or done
  • created_at: UTC timestamp
  • completed_at: UTC timestamp set when a task is completed

The documents table stores seeded document metadata and content:

  • id: auto-incrementing integer primary key
  • filename: unique source filename
  • title: document title
  • category: document category
  • summary: short document summary
  • content: full text loaded from sample_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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured