### Start MCP Server in Python Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Example of starting an MCP server using `stdio_server`. This code block should be placed after resource handlers are defined. ```python # Start server async with stdio_server() as streams: await app.run( streams[0], streams[1], app.create_initialization_options() ) ``` -------------------------------- ### Initialize MCP Client Environment Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Sets up the project directory, virtual environment, and installs necessary packages for an MCP client. Ensure Python and uv are installed. ```bash uv init mcp-client cd mcp-client uv venv # On Windows: .venv\Scripts\activate # On Unix or MacOS: source .venv/bin/activate uv add mcp anthropic python-dotenv rm hello.py touch client.py ``` -------------------------------- ### Install Dependencies Source: https://github.com/delorenj/mcp-server-trello/blob/main/README.md Command to install project dependencies using Bun. This should be run after cloning the repository. ```bash bun install ``` -------------------------------- ### Inspect NPM server package Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Start an MCP server package from NPM using the Inspector. This example demonstrates inspecting a PostgreSQL server. ```bash npx -y @modelcontextprotocol/inspector npx # For example npx -y @modelcontextprotocol/inspector npx server-postgres postgres://127.0.0.1/testdb ``` -------------------------------- ### Start the MCP Server Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Implement the main function to start the server and handle potential errors. Ensure you run 'npm run build' before starting. ```typescript async function main() { const transport = new StdioServerTransport(); await server.connect(transport); console.error("Weather MCP Server running on stdio"); } main().catch((error) => { console.error("Fatal error in main():", error); process.exit(1); }); ``` -------------------------------- ### Install Script with Fallback Source: https://github.com/delorenj/mcp-server-trello/blob/main/_bmad-output/planning-artifacts/architecture.md The install script for the skill, responsible for building from source and falling back to npm if Bun is unavailable. ```bash #!/usr/bin/env bash set -euo pipefail # Attempt to build from source using Bun if command -v bun &> /dev/null; then echo "Building from source using Bun..." bun install bun run build else echo "Bun not found. Falling back to npm..." # Fallback to npm if Bun is not available if command -v npm &> /dev/null; then npm install else echo "npm not found. Please install Node.js and npm." exit 1 fi fi echo "Installation complete." ``` -------------------------------- ### Inspect PyPi server package Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Start an MCP server package from PyPi using the Inspector. This example shows inspecting a Git-based MCP server. ```bash npx @modelcontextprotocol/inspector uvx # For example npx @modelcontextprotocol/inspector uvx mcp-server-git --repository ~/code/mcp/servers.git ``` -------------------------------- ### Install Trello MCP Server Source: https://github.com/delorenj/mcp-server-trello/blob/main/skill/references/trello-mcp/configuration.md Run the bundled installer script from the skill root directory to install the Trello MCP server locally. ```bash bash {skill-root}/scripts/install.sh ``` -------------------------------- ### NPM Fallback Installation Source: https://github.com/delorenj/mcp-server-trello/blob/main/_bmad-output/planning-artifacts/architecture.md If Bun is not found, the installation process falls back to using npm to install the project dependencies. ```bash npm install @delorenj/mcp-server-trello ``` -------------------------------- ### Install MCP Server Trello Skill Source: https://github.com/delorenj/mcp-server-trello/blob/main/README.md Run the installer script for the MCP server. This script builds the server using Bun if available, otherwise it falls back to a published Smithery install path. ```bash bash skill/scripts/install.sh ``` -------------------------------- ### Install and Run Git MCP Server with pip Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Install the git MCP server using pip and run it with the python -m command. This is an alternative to using uvx. ```bash pip install mcp-server-git python -m mcp_server_git ``` -------------------------------- ### Correct Concurrent Execution Example Source: https://github.com/delorenj/mcp-server-trello/blob/main/CLAUDE.md This example demonstrates the correct way to initialize a swarm, spawn agents, assign tasks, manage todos, and perform file operations within a single message for efficient parallel coordination. ```javascript [BatchTool]: // Initialize swarm mcp__claude-flow__swarm_init { topology: "mesh", maxAgents: 6 } mcp__claude-flow__agent_spawn { type: "researcher" } mcp__claude-flow__agent_spawn { type: "coder" } mcp__claude-flow__agent_spawn { type: "tester" } // Spawn agents with Task tool Task("Research agent: Analyze requirements...") Task("Coder agent: Implement features...") Task("Tester agent: Create test suite...") // Batch todos TodoWrite { todos: [ {id: "1", content: "Research", status: "in_progress", priority: "high"}, {id: "2", content: "Design", status: "pending", priority: "high"}, {id: "3", content: "Implement", status: "pending", priority: "high"}, {id: "4", content: "Test", status: "pending", priority: "medium"}, {id: "5", content: "Document", status: "pending", priority: "low"} ]} // File operations Bash "mkdir -p app/{src,tests,docs}" Write "app/src/index.js" Write "app/tests/index.test.js" Write "app/docs/README.md" ``` -------------------------------- ### Install MCP Server Trello CLI Source: https://github.com/delorenj/mcp-server-trello/blob/main/examples/README.md Installs the MCP Server Trello command-line interface globally. Ensure Node.js and npm are installed. ```bash npm install -g @delorenj/mcp-server-trello ``` -------------------------------- ### Verify Node.js and npm Installation Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Check if Node.js and npm are installed and meet the version requirements for the project. ```bash node --version npm --version ``` -------------------------------- ### Correct Concurrent Execution Example Source: https://github.com/delorenj/mcp-server-trello/blob/main/AGENTS.md This example demonstrates the correct way to initialize a swarm, spawn agents, and batch todos and file operations within a single message for efficient parallel execution. ```javascript [BatchTool]: // Initialize swarm mcp__claude-flow__swarm_init { topology: "mesh", maxAgents: 6 } mcp__claude-flow__agent_spawn { type: "researcher" } mcp__claude-flow__agent_spawn { type: "coder" } mcp__claude-flow__agent_spawn { type: "tester" } // Spawn agents with Task tool Task("Research agent: Analyze requirements...") Task("Coder agent: Implement features...") Task("Tester agent: Create test suite...") // Batch todos TodoWrite { todos: [ {id: "1", content: "Research", status: "in_progress", priority: "high"}, {id: "2", content: "Design", status: "pending", priority: "high"}, {id: "3", content: "Implement", status: "pending", priority: "high"}, {id: "4", content: "Test", status: "pending", priority: "medium"}, {id: "5", content: "Document", status: "pending", priority: "low"} ]} // File operations Bash "mkdir -p app/{src,tests,docs}" Write "app/src/index.js" Write "app/tests/index.test.js" Write "app/docs/README.md" ``` -------------------------------- ### Set Up Python Project and Environment Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Creates a new project directory, sets up a virtual environment, installs MCP and httpx dependencies, and creates necessary Python files. ```bash # Create a new directory for our project uv init weather cd weather # Create virtual environment and activate it uv venv source .venv/bin/activate # Install dependencies uv add mcp httpx # Remove template file rm hello.py # Create our files mkdir -p src/weather touch src/weather/__init__.py touch src/weather/server.py ``` ```powershell # Create a new directory for our project uv init weather cd weather # Create virtual environment and activate it uv venv .venv\Scripts\activate # Install dependencies uv add mcp httpx # Clean up boilerplate code rm hello.py # Create our files md src md src\weather new-item src\weather\__init__.py new-item src\weather\server.py ``` -------------------------------- ### Verify Node.js Installation Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Run this command in your terminal or command prompt to verify if Node.js is installed on your system. If not, download it from nodejs.org. ```bash node --version ``` -------------------------------- ### Idempotency Check for Installation Source: https://github.com/delorenj/mcp-server-trello/blob/main/_bmad-output/planning-artifacts/architecture.md The install.sh script checks for the existence of 'build/index.js' and a matching 'package.json' version to determine if a rebuild is necessary. If the build artifact exists and versions match, it reports as already installed. ```bash build/index.js exists AND package.json version matches installed npm version ``` ```bash [OK] Already installed ``` -------------------------------- ### Example Run Listing Source: https://github.com/delorenj/mcp-server-trello/blob/main/_bmad/custom/src/workflows/enhancement-forge/steps-e/step-01-load.md Lists recent runs with their status and associated issue, prompting the user to select a run by number or path. ```text Recent runs: [1] {YYYYMMDD-HHMM}-init (e.g., 20260507-1432-init) complete issue#142 [2] {YYYYMMDD-HHMM}-init (e.g., 20260506-2104-init) complete issue#138 [3] {YYYYMMDD-HHMM}-init (e.g., 20260505-1100-init) queued_for_review - ... Pick a run by number, or paste a path: ``` -------------------------------- ### Store API Pagination Pattern Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/REASONINGBANK_EXAMPLES.md Store a pattern for cursor-based API pagination, including example parameters. ```bash npx claude-flow@alpha memory store api_pagination \ "Cursor-based pagination: /api/items?limit=20&cursor=abc123" \ --namespace api_patterns --reasoningbank ``` -------------------------------- ### TypeScript Stdio Client Transport Setup Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Initialize an MCP client and connect it to a stdio transport, specifying the server command and arguments. ```typescript const client = new Client({ name: "example-client", version: "1.0.0" }, { capabilities: {} }); const transport = new StdioClientTransport({ command: "./server", args: ["--option", "value"] }); await client.connect(transport); ``` -------------------------------- ### Agent Pre-Task Hook Source: https://github.com/delorenj/mcp-server-trello/blob/main/CLAUDE.md Execute this command before starting a task to initialize the agent's environment and restore session context if needed. ```bash npx claude-flow@alpha hooks pre-task --description "[task]" ``` ```bash npx claude-flow@alpha hooks session-restore --session-id "swarm-[id]" ``` -------------------------------- ### Implement Resource Listing in TypeScript Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Example of implementing the `ListResourcesRequestSchema` to list available resources on an MCP server. Ensure `ListResourcesRequestSchema` is imported. ```typescript const server = new Server({ name: "example-server", version: "1.0.0" }, { capabilities: { resources: {} } }); // List available resources server.setRequestHandler(ListResourcesRequestSchema, async () => { return { resources: [ { uri: "file:///logs/app.log", name: "Application Logs", mimeType: "text/plain" } ] }; }); ``` -------------------------------- ### TypeScript Stdio Server Transport Setup Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Initialize an MCP server and connect it to a stdio transport for communication via standard input/output streams. ```typescript const server = new Server({ name: "example-server", version: "1.0.0" }, { capabilities: {} }); const transport = new StdioServerTransport(); await server.connect(transport); ``` -------------------------------- ### Implement MCP Server in Python Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Basic example of implementing an MCP server in Python using the stdio transport. Requires mcp library. ```python import asyncio import mcp.types as types from mcp.server import Server from mcp.server.stdio import stdio_server app = Server("example-server") @app.list_resources() async def list_resources() -> list[types.Resource]: return [ types.Resource( uri="example://resource", name="Example Resource" ) ] async def main(): async with stdio_server() as streams: await app.run( streams[0], streams[1], app.create_initialization_options() ) if __name__ == "__main__": asyncio.run(main) ``` -------------------------------- ### Implement Resource Listing in Python Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Example of implementing resource listing using the `@app.list_resources()` decorator. This function should return a list of `types.Resource` objects. ```python app = Server("example-server") @app.list_resources() async def list_resources() -> list[types.Resource]: return [ types.Resource( uri="file:///logs/app.log", name="Application Logs", mimeType="text/plain" ) ] ``` -------------------------------- ### Run Memory MCP Server with npx Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Use this command to directly run the memory MCP server. Ensure Node.js and npm are installed. ```bash npx -y @modelcontextprotocol/server-memory ``` -------------------------------- ### Python Stdio Server Transport Setup Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Set up an MCP server to run using the stdio transport, handling communication through standard input and output streams. ```python app = Server("example-server") async with stdio_server() as streams: await app.run( streams[0], streams[1], app.create_initialization_options() ) ``` -------------------------------- ### Configure Filesystem MCP Server for Windows Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Use this JSON configuration to add the Filesystem MCP Server for Windows. Ensure paths are correct for your system and Node.js is installed. ```json { "mcpServers": { "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "C:\\Users\\username\\Desktop", "C:\\Users\\username\\Downloads" ] } } } ``` -------------------------------- ### Example MCP Sampling Request Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Illustrates a typical request for sampling from a client, including messages, system prompt, context inclusion, and maximum token limit. ```json { "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 } } ``` -------------------------------- ### Configure Claude for Desktop (Windows) Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Add your weather server configuration to the 'mcpServers' key in the Claude for Desktop config file. This example uses Node.js to run the server. ```json { "mcpServers": { "weather": { "command": "node", "args": [ "C:\\PATH\\TO\\PARENT\\FOLDER\\weather\\build\\index.js" ] } } } ``` -------------------------------- ### Describe Server Requirements for LLM Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md This is an example of how to describe the desired functionality of an MCP server to an LLM. Be specific about resources, tools, prompts, and external system interactions. ```text Build an MCP server that: - Connects to my company's PostgreSQL database - Exposes table schemas as resources - Provides tools for running read-only SQL queries - Includes prompts for common data analysis tasks ``` -------------------------------- ### Implement MCP Server in TypeScript Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Basic example of implementing an MCP server in TypeScript, including setting up request handlers and connecting a transport. Requires @modelcontextprotocol/sdk. ```typescript import { Server } from "@modelcontextprotocol/sdk/server/index.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; const server = new Server({ name: "example-server", version: "1.0.0" }, { capabilities: { resources: {} } }); // Handle requests server.setRequestHandler(ListResourcesRequestSchema, async () => { return { resources: [ { uri: "example://resource", name: "Example Resource" } ] }; }); // Connect transport const transport = new StdioServerTransport(); await server.connect(transport); ``` -------------------------------- ### Main Entry Point and Execution Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Sets up the main execution logic for the client, handling command-line arguments for the server script path, initializing the client, and managing the chat loop and cleanup. ```python async def main(): if len(sys.argv) < 2: print("Usage: python client.py ") sys.exit(1) client = MCPClient() try: await client.connect_to_server(sys.argv[1]) await client.chat_loop() finally: await client.cleanup() if __name__ == "__main__": import sys asyncio.run(main()) ``` -------------------------------- ### Configure Claude for Desktop (MacOS/Linux) Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Add your weather server configuration to the 'mcpServers' key in the Claude for Desktop config file. This example uses Node.js to run the server. ```json { "mcpServers": { "weather": { "command": "node", "args": [ "/ABSOLUTE/PATH/TO/PARENT/FOLDER/weather/build/index.js" ] } } } ``` -------------------------------- ### Set Up Node.js Project Environment (Windows) Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Create a new project directory, initialize an npm project, install necessary dependencies, and set up the source directory and main TypeScript file on Windows. ```powershell # Create a new directory for our project md weather cd weather # Initialize a new npm project npm init -y # Install dependencies npm install @modelcontextprotocol/sdk zod npm install -D @types/node typescript # Create our files md src new-item src\index.ts ``` -------------------------------- ### Install uv Package Manager Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Installs the uv package manager. Ensure your terminal is restarted after installation for the 'uv' command to be recognized. ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` ```powershell powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" ``` -------------------------------- ### Set Up Node.js Project Environment (MacOS/Linux) Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Create a new project directory, initialize an npm project, install necessary dependencies, and set up the source directory and main TypeScript file. ```bash # Create a new directory for our project mkdir weather cd weather # Initialize a new npm project npm init -y # Install dependencies npm install @modelcontextprotocol/sdk zod npm install -D @types/node typescript # Create our files mkdir src touch src/index.ts ``` -------------------------------- ### Server Path Examples Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Demonstrates correct usage of server paths, including relative, absolute, and Windows-specific formats. Ensure forward slashes or escaped backslashes are used for Windows paths. ```bash uv run client.py ./server/weather.py ``` ```bash uv run client.py /Users/username/projects/mcp-server/weather.py ``` ```bash uv run client.py C:/projects/mcp-server/weather.py ``` ```bash uv run client.py C:\\projects\\mcp-server\\weather.py ``` -------------------------------- ### Build Project Source: https://github.com/delorenj/mcp-server-trello/blob/main/CLAUDE.md Compile and build the project using npm. ```bash npm run build ``` -------------------------------- ### Implement Basic Tool in MCP Server (TypeScript) Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Demonstrates how to set up an MCP server to handle tool listing and execution requests using TypeScript. Requires `Server`, `ListToolsRequestSchema`, and `CallToolRequestSchema`. ```typescript const server = new Server({ name: "example-server", version: "1.0.0" }, { capabilities: { tools: {} } }); // Define available tools server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [{ name: "calculate_sum", description: "Add two numbers together", inputSchema: { type: "object", properties: { a: { type: "number" }, b: { type: "number" } }, required: ["a", "b"] } }] }; }); // Handle tool execution server.setRequestHandler(CallToolRequestSchema, async (request) => { if (request.params.name === "calculate_sum") { const { a, b } = request.params.arguments; return { content: [ { type: "text", text: String(a + b) } ] }; } throw new Error("Tool not found"); }); ``` -------------------------------- ### Correct Concurrent Execution Example Source: https://github.com/delorenj/mcp-server-trello/blob/main/GEMINI.md Demonstrates the correct way to initialize a swarm, spawn agents, and batch tasks and file operations within a single message for efficient parallel coordination. ```javascript [BatchTool]: // Initialize swarm mcp__claude-flow__swarm_init { topology: "mesh", maxAgents: 6 } mcp__claude-flow__agent_spawn { type: "researcher" } mcp__claude-flow__agent_spawn { type: "coder" } mcp__claude-flow__agent_spawn { type: "tester" } // Spawn agents with Task tool Task("Research agent: Analyze requirements...") Task("Coder agent: Implement features...") Task("Tester agent: Create test suite...") // Batch todos TodoWrite { todos: [ {id: "1", content: "Research", status: "in_progress", priority: "high"}, {id: "2", content: "Design", status: "pending", priority: "high"}, {id: "3", content: "Implement", status: "pending", priority: "high"}, {id: "4", content: "Test", status: "pending", priority: "medium"}, {id: "5", content: "Document", status: "pending", priority: "low"} ]} // File operations Bash "mkdir -p app/{src,tests,docs}" Write "app/src/index.js" Write "app/tests/index.test.js" Write "app/docs/README.md" ``` -------------------------------- ### Incorrect Concurrent Execution Example Source: https://github.com/delorenj/mcp-server-trello/blob/main/CLAUDE.md This example shows an incorrect approach to concurrent execution where multiple messages are sent sequentially, breaking parallel coordination and potentially leading to errors. ```javascript Message 1: mcp__claude-flow__swarm_init Message 2: Task("agent 1") Message 3: TodoWrite { todos: [single todo] } Message 4: Write "file.js" // This breaks parallel coordination! ``` -------------------------------- ### Connect to SSE Server (Python Client) Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Establishes a connection to an SSE server and initializes a client session. Requires an active SSE server. ```python async with sse_client("http://localhost:8000/sse") as streams: async with ClientSession(streams[0], streams[1]) as session: await session.initialize() ``` -------------------------------- ### Get SPARC Mode Details Source: https://github.com/delorenj/mcp-server-trello/blob/main/CLAUDE.md Retrieve detailed information about a specific SPARC mode. ```bash npx claude-flow sparc info ``` -------------------------------- ### Get my cards Source: https://github.com/delorenj/mcp-server-trello/blob/main/README.md Fetches all cards assigned to the currently authenticated user. This operation takes no arguments. ```typescript {   name: 'get_my_cards',   arguments: {} } ``` -------------------------------- ### Configure MCP Servers in JSON Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Configure various MCP servers like memory, filesystem, and github within your application's configuration file. This example shows how to specify commands, arguments, and environment variables. ```json { "mcpServers": { "memory": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-memory"] }, "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/files"] }, "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "" } } } } ``` -------------------------------- ### Set up SSE Server with Starlette (Python) Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Configures an SSE server using Starlette for handling streaming and POST messages. Requires Starlette and MCP server setup. ```python from mcp.server.sse import SseServerTransport from starlette.applications import Starlette from starlette.routing import Route app = Server("example-server") sse = SseServerTransport("/messages") async def handle_sse(scope, receive, send): async with sse.connect_sse(scope, receive, send) as streams: await app.run(streams[0], streams[1], app.create_initialization_options()) async def handle_messages(scope, receive, send): await sse.handle_post_message(scope, receive, send) starlette_app = Starlette( routes=[ Route("/sse", endpoint=handle_sse), Route("/messages", endpoint=handle_messages, methods=["POST"]), ] ) ``` -------------------------------- ### Get Active Board Info Source: https://github.com/delorenj/mcp-server-trello/blob/main/README.md Retrieves information about the currently active board. This function does not require any arguments. ```typescript { name: 'get_active_board_info', arguments: {} } ``` -------------------------------- ### Get comments from a card Source: https://github.com/delorenj/mcp-server-trello/blob/main/README.md Retrieves all comments for a specific card, with an optional limit on the number of comments returned. ```typescript { name: 'get_card_comments', arguments: { cardId: string, // ID of the card to get comments from limit?: number // Optional: Maximum number of comments to retrieve (default: 100) } } ``` -------------------------------- ### Get Lists on Board Source: https://github.com/delorenj/mcp-server-trello/blob/main/README.md Retrieves all lists present on a specified Trello board. The board ID is optional. ```typescript { name: 'get_lists', arguments: { boardId?: string // Optional: ID of the board (uses default if not provided) } } ``` -------------------------------- ### Initialize Package Main Entry Point Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Defines the main entry point for the Python package, which runs the server asynchronously. ```python from . import server import asyncio def main(): """Main entry point for the package.""" asyncio.run(server.main()) # Optionally expose other important items at package level __all__ = ['main', 'server'] ``` -------------------------------- ### Agent Pre-Work Hooks Source: https://github.com/delorenj/mcp-server-trello/blob/main/GEMINI.md Commands to execute before an agent starts its work, including task initialization and session restoration. ```bash npx claude-flow@alpha hooks pre-task --description "[task]" npx claude-flow@alpha hooks session-restore --session-id "swarm-[id]" ``` -------------------------------- ### Basic MCP Client Structure Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Initializes the MCP client with necessary imports, session management, and the Anthropic client. Loads environment variables from a .env file. ```python import asyncio from typing import Optional from contextlib import AsyncExitStack from mcp import ClientSession, StdioServerParameters from mcp.client.stdio import stdio_client from anthropic import Anthropic from dotenv import load_dotenv load_dotenv() # load environment variables from .env class MCPClient: def __init__(self): # Initialize session and client objects self.session: Optional[ClientSession] = None self.exit_stack = AsyncExitStack() self.anthropic = Anthropic() # methods will go here ``` -------------------------------- ### Get Cards by List ID Source: https://github.com/delorenj/mcp-server-trello/blob/main/README.md Retrieves all cards associated with a specific Trello list. The board ID is optional. ```typescript { name: 'get_cards_by_list_id', arguments: { boardId?: string, // Optional: ID of the board (uses default if not provided) listId: string // ID of the Trello list } } ``` -------------------------------- ### get_checklist_items Source: https://github.com/delorenj/mcp-server-trello/blob/main/README.md Get all items from a checklist by its name. Optionally specify a board ID; otherwise, the default board is used. ```APIDOC ## get_checklist_items ### Description Get all items from a checklist by its name. Optionally specify a board ID; otherwise, the default board is used. ### Method Not specified (Tool Call) ### Endpoint Not applicable (Tool Call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body ```json { "name": "get_checklist_items", "arguments": { "name": "string", // Name of the checklist to retrieve items from "boardId": "string" // Optional: ID of the board (uses default if not provided) } } ``` ### Request Example ```json { "name": "get_checklist_items", "arguments": { "name": "My Checklist", "boardId": "abc123def456" } } ``` ### Response #### Success Response - **items** (array) - A list of checklist items. #### Response Example (Response structure not explicitly defined in source, but implies a list of items) ``` -------------------------------- ### Prepare Release with Trello Card and Checklist Source: https://github.com/delorenj/mcp-server-trello/blob/main/examples/usage-examples.md Automates the creation of a release card in Trello, adds a checklist of release tasks, and links relevant 'done' cards. ```javascript async function prepareRelease(version, releaseDate) { // Create release card const releaseCard = await use_mcp_tool({ server_name: "trello", tool_name: "add_card_to_list", arguments: { listId: "releases-list-id", name: `Release ${version}`, description: `# Release ${version}\n\n**Target Date**: ${releaseDate}\n**Status**: Preparing`, dueDate: new Date(releaseDate).toISOString(), labels: ["release", "high-priority"] } }); // Add release checklist items const releaseChecklist = [ "Code freeze completed", "All tests passing", "Security scan completed", "Performance benchmarks verified", "Documentation updated", "Release notes prepared", "Stakeholders notified", "Deployment plan reviewed", "Rollback plan prepared", "Production deployment completed" ]; for (const item of releaseChecklist) { await use_mcp_tool({ server_name: "trello", tool_name: "add_checklist_item", arguments: { text: item, checkListName: "Release Checklist" } }); } // Find all cards targeted for this release const allCards = await use_mcp_tool({ server_name: "trello", tool_name: "get_cards_by_list_id", arguments: { listId: "done-list-id" } }); // Link related cards by adding comments for (const card of allCards) { if (card.labels.includes(`release-${version}`)) { await use_mcp_tool({ server_name: "trello", tool_name: "add_comment", arguments: { cardId: card.id, text: `Included in Release ${version} - https://trello.com/c/${releaseCard.shortLink}` } }); } } return releaseCard; } ``` -------------------------------- ### Get Active Board Info Tool Source: https://github.com/delorenj/mcp-server-trello/blob/main/README.md Use the 'get_active_board_info' tool to check the details of the currently active board. ```typescript { name: 'get_active_board_info', arguments: {} } ``` -------------------------------- ### Implement Basic Tool in MCP Server (Python) Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Shows how to register and handle tool requests for an MCP server using Python decorators. Ensure `types` is imported for `Tool` and content types. ```python app = Server("example-server") @app.list_tools() async def list_tools() -> list[types.Tool]: return [ types.Tool( name="calculate_sum", description="Add two numbers together", inputSchema={ "type": "object", "properties": { "a": {"type": "number"}, "b": {"type": "number"} }, "required": ["a", "b"] } ) ] @app.call_tool() async def call_tool( name: str, arguments: dict ) -> list[types.TextContent | types.ImageContent | types.EmbeddedResource]: if name == "calculate_sum": a = arguments["a"] b = arguments["b"] result = a + b return [types.TextContent(type="text", text=str(result))] raise ValueError(f"Tool not found: {name}") ``` -------------------------------- ### Get Checklist by Name Source: https://github.com/delorenj/mcp-server-trello/blob/main/README.md Retrieves a specific checklist by its name, including all its items and completion status. The board ID is optional. ```typescript { name: 'get_checklist_by_name', arguments: { name: string, // Name of the checklist to retrieve boardId?: string // Optional: ID of the board (uses default if not provided) } } ``` -------------------------------- ### Get Active Board Info Source: https://github.com/delorenj/mcp-server-trello/blob/main/README.md Retrieves information about the currently active board. This is useful for confirming the current context of operations. ```APIDOC ## get_active_board_info ### Description Retrieves information about the currently active board. This is useful for confirming the current context of operations. ### Method Not specified (Tool Call) ### Endpoint Not applicable (Tool Call) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body ```json { "name": "get_active_board_info", "arguments": {} } ``` ### Request Example ```json { "name": "get_active_board_info", "arguments": {} } ``` ### Response #### Success Response - **boardInfo** (object) - Information about the active board. #### Response Example (Response structure not explicitly defined in source, but implies an object containing board information) ``` -------------------------------- ### Initialize Server Configuration and Schemas Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Define constants for the NWS API base URL and user agent, set up Zod schemas for validating tool arguments, and initialize the MCP server instance. ```typescript const NWS_API_BASE = "https://api.weather.gov"; const USER_AGENT = "weather-app/1.0"; // Define Zod schemas for validation const AlertsArgumentsSchema = z.object({ state: z.string().length(2), }); const ForecastArgumentsSchema = z.object({ latitude: z.number().min(-90).max(90), longitude: z.number().min(-180).max(180), }); // Create server instance const server = new Server( { name: "weather", version: "1.0.0", }, { capabilities: { tools: {}, }, } ); ``` -------------------------------- ### Clone Repository Source: https://github.com/delorenj/mcp-server-trello/blob/main/README.md Command to clone the MCP Server Trello repository from GitHub. This is the first step in the local development setup. ```bash git clone https://github.com/delorenj/mcp-server-trello cd mcp-server-trello ``` -------------------------------- ### Run Git MCP Server with uvx Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Use uvx to manage and run the git MCP server. This is the recommended method for Python-based servers. ```bash uvx mcp-server-git ``` -------------------------------- ### Store a simple pattern with CLI Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/REASONINGBANK_EXAMPLES.md Use the CLI to store a pattern with a specific namespace and enable ReasoningBank. ```bash npx claude-flow@alpha memory store api_key \ "JWT tokens with HMAC SHA256 signing" \ --namespace backend --reasoningbank ``` -------------------------------- ### Store API Error Format Pattern Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/REASONINGBANK_EXAMPLES.md Store a pattern for consistent API error formatting, showing an example JSON structure. ```bash npx claude-flow@alpha memory store api_error_format \ 'Consistent error format: {"error": true, "message": "...", "code": 400}' \ --namespace api_patterns --reasoningbank ```