Trello MCP Server

repository·main·Indexed 19 days ago

https://github.com/delorenj/mcp-server-trello

An MCP (Model Context Protocol) server that integrates Trello with AI agents. Powered by Bun, it provides tools for board and workspace management, high-fidelity card data retrieval, and specialized workflows such as acceptance criteria extraction and intelligent checklist management. Supports dynamic board switching, rate limit handling via a token bucket algorithm, and integration with clients like Claude Desktop and Cursor.

Tokens
49.3K
Snippets
117
Records
196
Agent score
62%

What's inside @delorenj/mcp-server-trello

  1. Trello MCP Server Core Capabilities

    main

    The server is built with several robust infrastructure features designed to ensure reliable communication with the Trello API:

    • Rate Limiting: Uses a token bucket algorithm with separate limits for the API key (300 requests per 10s) and the token (100 requests per 10s). It includes automatic request queuing and graceful retries when limits are reached.
    • Input Validation: All tool inputs undergo comprehensive validation, including type checking for strings, numbers, and arrays, as well as required field verification.
    • Error Handling: Features an Axios-based client with automatic error handling, retries, and custom error messages for validation failures.
  2. Overview of the Trello MCP Skill structure

    main

    The Trello MCP skill is organized using a progressive disclosure pattern to help agents navigate a large number of tools (25+) without overloading their context window. The structure follows a specific hierarchy:

    • SKILL.md: The primary discovery layer. It contains decision trees and a product index that acts as a router, directing agents to the correct reference files.
    • references/trello-mcp/: A directory containing specialized knowledge files:
      • README.md: The entry point for the reference section, defining reading order and cross-references.
      • configuration.md: Details on authentication (TRELLO_API_KEY, TRELLO_TOKEN) and rate limits.
      • api.md: Canonical tool signatures (automatically extracted from TypeScript definitions).
      • patterns.md: Guidance on common workflows (e.g., Board $\rightarrow$ Card $\rightarrow$ Checklist).
      • gotchas.md: Critical operational details like date formats, limits, and error recovery.
    • assets/source/: Contains the bundled MCP server source code for self-contained builds.
    • scripts/install.sh: The runtime layer responsible for building the server from source or falling back to npm.
  3. What are MCP Prompts and how to use them

    main

    Prompts are predefined, reusable templates defined by the server. They allow servers to provide standardized workflows to clients.

    Key characteristics:

    • Dynamic: They can accept arguments.
    • Contextual: They can include context from resources.
    • User-controlled: They are designed to be exposed to the client so users can explicitly select them (e.g., via slash commands in a UI).
  4. Architectural Patterns for Trello MCP

    main

    When building on top of the Trello MCP server, follow these established patterns:

    Client Wrapper Pattern

    Wrap the MCP tool invocation in a client class to provide a cleaner API for your application.

    class TrelloMCPClient {
        async callTool(toolName, args) {
            // MCP tool invocation
        }
    }

    Manager Classes

    Instead of calling tools directly, organize functionality into logical manager classes:

    • SprintManager: Sprint-specific operations.
    • BugTracker: Bug management workflows.
    • ReleaseManager: Release coordination.
    • TaskManager: General task operations.
  5. What are MCP Tools and how do they work?

    main

    Tools are a powerful primitive in the Model Context Protocol (MCP) that allow servers to expose executable functionality to clients. Unlike resources, which are typically static data, tools represent dynamic operations that can modify state or interact with external systems (e.g., running a shell command, creating a GitHub issue, or analyzing a CSV).

    Key characteristics:

    • Model-controlled: Tools are intended to be automatically invoked by the AI model, typically with a human-in-the-loop to grant approval.
    • Discovery: Clients discover available tools via the tools/list endpoint.
    • Invocation: Clients execute tools using the tools/call endpoint.
    • Dynamic: Tools can be added, removed, or updated during runtime, and servers can notify clients of changes using notifications/tools/list_changed.
  6. How the SKILL.md workflow works for AI agents

    main

    The SKILL.md file acts as a progressive-discovery router for AI agents using the Trello MCP server. Instead of scanning the entire repository, agents use SKILL.md to find specific setup instructions, API references, and workflow guides.

    Key features of the SKILL.md workflow include:

    • Trigger-rich frontmatter: Uses explicit Trello domain names in the frontmatter to trigger skill loading in compatible agents.
    • Tool Routing Groups: Organizes Trello tools into logical capability groups: boards, cards, checklists, comments, attachments, labels, members, and health.
    • Guardrails: Provides explicit rules for agents regarding ID discovery, date handling, rate limits, and destructive actions to prevent errors during Trello operations.
    • Reference Routing: Points agents to focused reference files to keep the main workflow guide compact while providing deep context for specific operations.
  7. Understand Trello MCP server rate limiting

    main

    The server uses a token bucket algorithm to manage requests and comply with Trello's API limits. Rate limiting is handled automatically, and requests are queued if limits are reached.

    Limits:

    • 300 requests per 10 seconds per API key
    • 100 requests per 10 seconds per token
  8. Core MCP Capabilities: Resources, Tools, and Prompts

    main

    MCP servers provide three primary types of capabilities to clients:

    1. Resources: Read-only, file-like data (e.g., API responses, file contents).
    2. Tools: Executable functions that an LLM can call (typically requiring user approval).
    3. Prompts: Pre-written templates designed to help users accomplish specific tasks.

    This distinction allows developers to choose the most appropriate way to expose data or functionality to an LLM.

  9. Implement a Continuous Learning Loop (SAFLA)

    main

    The SAFLA (Self-Aware Feedback Loop Algorithm) pattern implements a continuous cycle of observation, analysis, learning, adaptation, and feedback.

    Workflow:

    1. OBSERVE: Query reasoningBank.query with a minConfidence threshold.
    2. ANALYZE: Evaluate the relevance and reliability of retrieved patterns.
    3. LEARN: Select the best pattern.
    4. ADAPT: Execute the task using the selected pattern.
    5. FEEDBACK: Update the pattern's reliability in the reasoningBank based on success or failure and store the new outcome.
    // Implement SAFLA (Self-Aware Feedback Loop Algorithm)
    class SAFLAAgent {
      async executeSAFLACycle(task) {
        // 1. OBSERVE: Retrieve relevant patterns
        const patterns = await this.reasoningBank.query(task, {
          namespace: this.namespace,
          minConfidence: 0.4
        });
    
        // 2. ANALYZE: Evaluate pattern relevance and confidence
        const analysis = this.analyzePatterns(patterns);
    
        // 3. LEARN: Select best approach
        const selectedPattern = analysis.bestPattern;
    
        // 4. ADAPT: Execute with selected pattern
        const result = await this.execute(selectedPattern, task);
    
        // 5. FEEDBACK: Update confidence and store outcome
        await this.updateConfidence(selectedPattern.id, result.success);
        await this.storeOutcome(task, result);
    
        // Return to step 1 for next task
        return result;
      }
    
      analyzePatterns(patterns) {
        return {
          bestPattern: patterns[0],
          alternatives: patterns.slice(1),
          confidence: patterns[0]?.components.reliability || 0.5
        };
      }
    
      async updateConfidence(patternId, success) {
        const pattern = await this.reasoningBank.getPattern(patternId);
    
        if (success) {
          pattern.components.reliability = Math.min(
            1.0,
            pattern.components.reliability + 0.15
          );
        } else {
          pattern.components.reliability = Math.max(
            0.0,
            pattern.components.reliability - 0.1
          );
        }
    
        await this.reasoningBank.updatePattern(patternId, pattern);
      }
    }
  10. Use Sampling to request LLM completions

    main

    Sampling allows an MCP server to request LLM completions through the client. This enables agentic behavior while maintaining security via a human-in-the-loop design: the client reviews the request, samples from an LLM, and returns the result to the server.

    Note: This feature is currently not supported in the Claude Desktop client.

    Requesting a Sample

    Servers send a sampling/createMessage request. The request can include:

    • messages: Conversation history (roles: user or assistant; content: text or image).
    • modelPreferences: Hints for model selection (e.g., name: "claude-3") and priority levels for costPriority, speedPriority, and intelligencePriority (0-1).
    • systemPrompt: A requested system prompt.
    • includeContext: Determines context scope ("none", "thisServer", or "allServers").
    • temperature, maxTokens, stopSequences, and metadata.

    Response Format

    The client returns a completion containing the model used, the role of the response, and the content (text or image).

    {
      "method": "sampling/createMessage",
      "params": {
        "messages": [
          {
            "role": "user",
            "content": {
              "type": "text",
              "text": "What files are in the current directory?"
            }
          }
        ],
        "systemPrompt": "You are a helpful file system assistant.",
        "includeContext": "thisServer",
        "maxTokens": 100
      }
    }
  11. What are Roots in MCP?

    main

    Roots are URIs that a client suggests a server should focus on. They define the boundaries within which a server operates. While primarily used for filesystem paths, they can be any valid URI (e.g., https://api.example.com/v1).

    Purpose

    • Guidance: Informs servers about relevant resources and locations.
    • Clarity: Defines which resources are part of the active workspace.
    • Organization: Allows working with multiple distinct resource sets (e.g., a local repo and a remote API) simultaneously.

    Implementation Notes

    Roots are informational, not strictly enforcing. Servers should respect provided roots, use them to locate resources, and prioritize operations within those boundaries. Clients declare the roots capability during connection and provide a list of suggested roots.

    {
      "roots": [
        {
          "uri": "file:///home/user/projects/frontend",
          "name": "Frontend Repository"
        },
        {
          "uri": "https://api.example.com/v1",
          "name": "API Endpoint"
        }
      ]
    }
  12. Understand the MCP client-server architecture

    main

    The Model Context Protocol (MCP) operates on a client-server architecture designed to standardize how AI models access data and tools.

    • MCP Hosts: Applications (like Claude Desktop or IDEs) that want to access data.
    • MCP Clients: Protocol clients that maintain a 1:1 connection with a specific server.
    • MCP Servers: Lightweight programs that expose specific capabilities (tools, resources, or prompts) via the MCP protocol.
    • Data Sources: Can be Local (files, databases on your machine) or Remote (external services accessed via Web APIs).