Skip to main content
Glama

TDS MCP Server

A Model Context Protocol (MCP) server for the Temporal Documentation System (TDS). This server enables AI assistants to interact with TDS projects, providing access to guides, anchors, and patterns.

Features

  • TDS Resource Access: Browse and read TDS guides, anchors, and patterns

  • Advanced Multi-layer Search: Search across all TDS layers with filtering, relevance scoring, and multiple sort options

  • Smart Context Awareness: Get relevant TDS knowledge for current work context

  • Enhanced Comment Promotion: Promote LEARNING comments to anchors with automatic cleanup

  • Intelligent Health Reports: Generate actionable reports with high-value learning detection and pattern candidates

  • Multi-line Comment Support: Extract full context from multi-line TDS comments

  • Configurable Setup: Customize behavior with .tdsrc.json configuration file

  • Multi-language Support: Works with JavaScript, TypeScript, Python, Go, Java, C++, C, Rust, Ruby, and PHP

Related MCP server: My First MCP

Installation

  1. Navigate to the TDS MCP server directory:

    cd tds-mcp
  2. Install dependencies:

    npm install
  3. Build the server:

    npm run build

Usage

Development Mode

Run the server in development mode with hot reloading:

npm run dev

Production Mode

Build and run the server:

npm run build
npm start

MCP Client Configuration

To use this server with an MCP client (like Claude Desktop), add the following configuration:

Claude Desktop Configuration

Add to your Claude Desktop configuration file:

{
    "mcpServers": {
        "tds": {
            "command": "node",
            "args": ["/path/to/tds-mcp/build/index.js"],
            "env": {}
        }
    }
}

TDS Project Structure

The server expects the following TDS project structure:

your-project/
├── anchors/
│   ├── domain/
│   ├── integrations/
│   └── lessons-learned/
├── patterns/
│   ├── error-handling/
│   ├── integrations/
│   └── testing/
└── src/
    └── [your code files with TDS comments]

TDS Comment Format

The server recognizes these TDS comment types:

JavaScript/TypeScript

// TODO: Known issues needing attention
// HACK: Temporary workarounds with context
// NOTE: Important context for future changes
// LEARNING: Fresh discoveries and insights
// FIXME: Bugs requiring immediate attention

Python

# TODO: Known issues needing attention
# HACK: Temporary workarounds with context
# NOTE: Important context for future changes
# LEARNING: Fresh discoveries and insights
# FIXME: Bugs requiring immediate attention

Go

// TODO: Known issues needing attention
// HACK: Temporary workarounds with context
// NOTE: Important context for future changes
// LEARNING: Fresh discoveries and insights
// FIXME: Bugs requiring immediate attention

Available Tools

Search across all TDS layers with advanced filtering and relevance scoring.

Parameters:

  • query (required): Search query string

  • layer (optional): Layer to search in (guides, anchors, patterns, or all)

  • comment_type (optional): Filter by comment type (TODO, HACK, NOTE, LEARNING, FIXME, or all)

  • priority (optional): Filter by priority level (high, normal, or all)

  • sort_by (optional): Sort results by (relevance, date, or priority)

Example:

{
    "tool": "tds_search",
    "arguments": {
        "query": "payment API",
        "layer": "all",
        "comment_type": "LEARNING",
        "priority": "high",
        "sort_by": "relevance"
    }
}

tds_report

Generate a TDS health report showing usage statistics.

Parameters:

  • detailed (optional): Include detailed analysis (default: false)

Example:

{
    "tool": "tds_report",
    "arguments": {
        "detailed": true
    }
}

tds_promote

Promote a LEARNING comment to an anchor document with automatic cleanup.

Parameters:

  • file (required): Source file path

  • line (required): Line number of the LEARNING comment

  • title (required): Title for the new anchor

  • category (optional): Anchor category (domain, integrations, lessons-learned)

Example:

{
    "tool": "tds_promote",
    "arguments": {
        "file": "src/payment.js",
        "line": 45,
        "title": "Payment API Timezone Requirements",
        "category": "integrations"
    }
}

tds_get_context

Get relevant TDS knowledge for current work context.

Parameters:

  • file_path (optional): Current file path for context

  • topic (optional): Topic or keyword to find relevant knowledge about

  • type (optional): Type of context to retrieve (all, anchors, patterns, learnings)

Example:

{
    "tool": "tds_get_context",
    "arguments": {
        "file_path": "src/payment.js",
        "topic": "API authentication",
        "type": "all"
    }
}

Configuration

The server can be customized using a .tdsrc.json configuration file in your project root:

{
  "anchorCategories": [
    "domain",
    "integrations", 
    "lessons-learned",
    "security",
    "performance"
  ],
  "patternCategories": [
    "error-handling",
    "integrations",
    "testing",
    "security"
  ],
  "includePatterns": {
    "guides": [
      "**/*.{js,ts,py,go,java,cpp,c,rs,rb,php}",
      "**/*.{jsx,tsx,vue,svelte}"
    ],
    "anchors": [
      "anchors/**/*.md",
      "docs/anchors/**/*.md"
    ],
    "patterns": [
      "patterns/**/*.md",
      "docs/patterns/**/*.md"
    ]
  },
  "excludePatterns": [
    "node_modules/**",
    "build/**",
    "dist/**",
    ".git/**"
  ],
  "commentTypes": [
    "TODO",
    "HACK",
    "NOTE", 
    "LEARNING",
    "FIXME",
    "WARNING"
  ],
  "highPriorityKeywords": [
    "critical",
    "important",
    "security",
    "performance",
    "cost",
    "hours"
  ]
}

See .tdsrc.example.json for a full example configuration.

Resources

The server provides access to TDS resources through URIs:

Guides Layer (Comments)

  • URI: tds://guides/{file_path}

  • Format: JSON array of TDS comments

  • Example: tds://guides/src/payment.js

Anchors Layer (Documents)

  • URI: tds://anchors/{file_path}

  • Format: Markdown content

  • Example: tds://anchors/integrations/payment-api.md

Patterns Layer (Documents)

  • URI: tds://patterns/{file_path}

  • Format: Markdown content

  • Example: tds://patterns/error-handling/retry-patterns.md

Development

Project Structure

tds-mcp/
├── src/
│   └── index.ts          # Main server implementation
├── build/                # Compiled output
├── package.json          # Dependencies and scripts
├── tsconfig.json         # TypeScript configuration
└── README.md            # This file

Scripts

  • npm run build - Compile TypeScript to JavaScript

  • npm run dev - Run in development mode with hot reloading

  • npm start - Run the compiled server

Adding New Tools

To add new TDS tools:

  1. Add the tool definition to the ListToolsRequestSchema handler

  2. Add the tool implementation to the CallToolRequestSchema handler

  3. Create the implementation function

Example:

// In ListToolsRequestSchema handler
{
  name: 'tds_new_tool',
  description: 'Description of the new tool',
  inputSchema: {
    type: 'object',
    properties: {
      // Define parameters
    }
  }
}

// In CallToolRequestSchema handler
case 'tds_new_tool':
  return await handleNewTool(args.param1, args.param2);

// Implementation function
async function handleNewTool(param1: string, param2: string) {
  // Implementation
  return {
    content: [
      {
        type: 'text',
        text: 'Tool result'
      }
    ]
  };
}

Troubleshooting

Common Issues

  1. Server won't start: Check that all dependencies are installed with npm install

  2. No TDS comments found: Ensure your code files contain properly formatted TDS comments

  3. Anchors not found: Check that the anchors/ directory exists and contains markdown files

  4. Patterns not found: Check that the patterns/ directory exists and contains markdown files

Debug Mode

Run the server with debug output:

DEBUG=* npm run dev

Logs

The server logs to stderr, so you can redirect output:

npm start 2> tds-mcp.log

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes

  4. Add tests if applicable

  5. Submit a pull request

Support

For issues and questions:

Available Tools

4 tools
tds_get_contextC

Get relevant TDS knowledge for current work context

Inputs: type, topic, file_path.

tds_promoteC

Promote a LEARNING comment to an anchor

Inputs: file (required), line (required), title (required), category.

tds_reportC

Generate TDS health report

Inputs: detailed.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.9/5.0

    Scored across 4 tools

    Disambiguation3/5

    tds_search and tds_get_context overlap conceptually, since both retrieve TDS knowledge, and their boundary depends on whether the agent supplies a query or a work context. tds_report and tds_promote are clearly distinct, but the search/context pair may cause misselection.

    Naming Consistency4/5

    All tools use a consistent tds_ prefix, and most follow a simple tds_verb pattern. tds_get_context introduces a verb_noun form, which is a minor deviation but still readable and predictable.

    Tool Count4/5

    Four tools is a focused, well-scoped surface for a knowledge-retrieval and promotion server. Each tool has a plausible distinct role, though the set is slightly thin for the apparent breadth of TDS layers.

    Completeness2/5

    The surface covers search, context retrieval, reporting, and promotion, but lacks lifecycle operations for guides, anchors, and patterns such as create, update, delete, or list. Agents cannot manage the underlying knowledge base beyond promoting a learning comment.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to search and retrieve information from Teleport documentation using a vector database. It provides a tool for semantic vector search over pre-populated embeddings of Teleport pages and examples to assist with technical queries.
      1
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to discover and invoke tools for saving and retrieving code snippets, generating style guides and wiki documentation, and orchestrating multi-agent documentation workflows with semantic search.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to discover and invoke tools for saving and retrieving code snippets, generating language-specific style guides and deep wiki documentation, and orchestrating multi-agent documentation workflows backed by semantic vector search.
      -