MC

MCP Server for Multi-File Task Management

Manage multi-file tasks with an efficient MCP server—budget-optimized, multi-format, searchable, real-time updates and safe TypeScript-backed operations

Quick Install
npx -y @flesler/mcp-tasks

Overview

This MCP (Model Context Protocol) server provides a lightweight backend for managing multi-file tasks and the context that LLMs need to operate on them. It centralizes storage, indexing and retrieval for sets of files (code, docs, data), exposing a predictable API for adding, updating and querying task contexts. The server is designed to be budget-aware, reducing token and embedding costs by chunking and prioritizing context material based on relevance.

Beyond storage and search, the server supports real-time updates (so clients can subscribe to changes) and a TypeScript-backed execution endpoint that validates and safely runs small, typed operations against a task’s files. That makes it suitable for workflows like multi-file QA, codebase summarization, incremental editing and agentic workflows where contextual accuracy and cost control matter.

Features

  • Multi-file task model: group related files under a single task identifier.
  • Multi-format support: text, Markdown, code, JSON, CSV and other plain-text formats.
  • Budget-optimized context: chunking and prioritization to minimize token/embedding usage.
  • Searchable context: vector and text-search over chunks to retrieve relevant context for prompts.
  • Real-time updates: subscribe to task changes (WebSocket/SSE) to reflect edits immediately.
  • Safe TypeScript-backed operations: type-checked, sandboxed execution for file-aware transformations and queries.
  • Multiple storage adapters: in-memory and disk-backed stores (pluggable).
  • REST API and CLI-friendly endpoints for easy integration.

Installation / Configuration

Install from npm and run the server (example):

# Install (if published) or clone and install locally
npm install @your-org/mcp-tasks
# or if running from repo
git clone https://github.com/flesler/mcp-tasks
cd mcp-tasks
npm install

# Start with default config
npm start

Environment variables (example):

# Port to listen on
MCP_PORT=8080

# Storage location (for disk adapter)
MCP_STORAGE_PATH=./data

# Embeddings provider config (optional)
EMBEDDINGS_PROVIDER=openai
EMBEDDINGS_API_KEY=sk-...

# Budget settings (tokens/requests)
MCP_MAX_TOKENS=2000

Example minimal configuration file (mcp.config.ts):

export default {
  port: 8080,
  storage: { type: "disk", path: "./data" },
  embeddings: { provider: "openai", model: "text-embedding-3-small" },
  budget: { maxTokens: 2000, chunkSize: 500 }
};

Available Resources

The server exposes multiple integration surfaces:

  • REST API for CRUD operations on tasks and files.
  • Search endpoint for text/vector queries against a task’s chunks.
  • Real-time subscriptions via WebSocket or Server-Sent Events to get update notifications.
  • TypeScript-backed endpoint for safe, typed operations against task data.
  • CLI utilities for quick task creation, file imports, and local debugging.

Common endpoints (table):

MethodPathPurpose
POST/tasksCreate a new task
GET/tasks/:idGet task metadata
POST/tasks/:id/filesUpload or update a file
GET/tasks/:id/files/:fileDownload file contents
POST/tasks/:id/searchSearch (text or vector)
GET/subscribe?taskId=Subscribe to updates (WS/SSE)
POST/tasks/:id/typescriptRun a typed operation against files

Request and response payloads use JSON; file uploads accept multipart/form-data.

Use Cases

  1. Multi-file Q&A for a repository

    • Upload project files under a task. Use the search endpoint to fetch the most relevant chunks for a user question, then pass those chunks into an LLM. Real-time updates let the UI refresh context after edits.
  2. Incremental code editing assistant

    • Store code files and run TypeScript-backed checks or transformations that are type-checked before applying. The server ensures operations are sandboxed and only operate on the task’s files.
  3. Budget-optimized summarization pipeline

    • Configure chunk size and budget thresholds so long files are summarized first and only the most relevant chunks are embedded and sent to the model.
  4. Data curation and review

    • Import CSV/JSON files, index them as text chunks, and let reviewers query, annotate and patch entries while keeping a searchable audit trail.

Getting Started Tips

  • Start with the disk storage adapter for persistence in development; switch to an in-memory store for ephemeral or test runs.
  • Tune chunkSize and maxTokens to match your LLM pricing and latency tradeoffs.
  • Use the TypeScript endpoint for safe, automated refactors or typed queries rather than letting client-provided code run on the server.
  • Subscribe to real-time updates from clients to maintain a responsive editor or dashboard.

If you need to integrate with a specific embedding provider or vector store, the server was designed to allow swapping providers via configuration. Check the repo for adapter examples and tests to guide customization.