### Inspecting NPM package Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Start a server package from NPM. The example shows using the server-postgres package with a connection string. ```bash npx -y @modelcontextprotocol/inspector npx # For example npx -y @modelcontextprotocol/inspector npx server-postgres postgres://127.0.0.1/testdb ``` -------------------------------- ### Inspecting PyPi package Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Start a server package from PyPi. The example shows using the mcp-server-git package with a repository path. ```bash npx @modelcontextprotocol/inspector uvx # For example npx @modelcontextprotocol/inspector uvx mcp-server-git --repository ~/code/mcp/servers.git ``` -------------------------------- ### Set up project (Windows) Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Creates a new project directory, initializes npm, installs dependencies, and creates the source file for the weather server 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 ``` -------------------------------- ### Set up project (MacOS/Linux) Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Creates a new project directory, initializes npm, installs dependencies, and creates the source file for the weather server on macOS/Linux. ```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 ``` -------------------------------- ### Example resource URIs Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Example URIs for file, postgres, and screen protocols. These illustrate the URI format for different resource types. ```text file:///home/user/documents/report.pdf ``` ```text postgres://database/customers/schema ``` ```text screen://localhost/display1 ``` -------------------------------- ### Implementing a Basic Tool (Python) Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Python example of an MCP server that lists a 'calculate_sum' tool and handles its invocation, returning the sum as text content. ```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}") ``` -------------------------------- ### Install dependencies with bun Source: https://github.com/delorenj/mcp-server-trello/blob/main/README.md Installs project dependencies using the Bun package manager. ```bash bun install ``` -------------------------------- ### Install uv on Windows (PowerShell) Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Installs the uv package manager on Windows via PowerShell. Run in PowerShell; restart the terminal afterward so the uv command is available. ```powershell powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" ``` -------------------------------- ### Basic MCP server implementation in Python Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Example of setting up an MCP server using the Python SDK, defining a resource handler, and running with stdio transport. ```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) ``` -------------------------------- ### Python MCP server resource implementation Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Example of implementing resource support in an MCP server using Python. It defines list and read resource handlers, returning the log file contents or raising a ValueError for unknown resources, and starts the server with stdio. ```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" ) ] @app.read_resource() async def read_resource(uri: AnyUrl) -> str: if str(uri) == "file:///logs/app.log": log_contents = await read_log_file() return log_contents raise ValueError("Resource not found") # Start server async with stdio_server() as streams: await app.run( streams[0], streams[1], app.create_initialization_options() ) ``` -------------------------------- ### Install Trello MCP skill package Source: https://github.com/delorenj/mcp-server-trello/blob/main/README.md Run this bash command to install the BMAD-compatible skill package for the Trello MCP server. The installer builds the server from skill/assets/source/ when Bun is available, otherwise it falls back to the published Smithery install path. ```bash bash skill/scripts/install.sh ``` -------------------------------- ### Set up Python project with uv Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Commands to initialize a new Python project, create a virtual environment, install required packages (mcp, anthropic, python-dotenv), and create the main client file. ```bash # Create project directory uv init mcp-client cd mcp-client # Create virtual environment uv venv # Activate virtual environment # On Windows: .venv\Scripts\activate # On Unix or MacOS: source .venv/bin/activate # Install required packages uv add mcp anthropic python-dotenv # Remove boilerplate files rm hello.py # Create our main file touch client.py ``` -------------------------------- ### Install uv on MacOS/Linux Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Installs the uv package manager on macOS/Linux. Run in a terminal; restart the terminal afterward so the uv command is available. ```bash curl -LsSf https://astral.sh/uv/install.sh | sh ``` -------------------------------- ### Check Node.js and npm versions Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Verifies that Node.js and npm are installed and accessible. Required before proceeding with the TypeScript tutorial. ```bash node --version npm --version ``` -------------------------------- ### Pre-Task Retrieval: Query and Display Relevant Patterns Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/REASONINGBANK_EXAMPLES.md Use this snippet before starting a task to retrieve relevant patterns from the ReasoningBank, display them to the user/agent, and let the user select a pattern or proceed with a new approach. The example queries with a namespace and limit, then prompts for selection. ```javascript // Before starting a task, retrieve relevant patterns async function executeTask(task) { // 1. Query ReasoningBank const relevantPatterns = await reasoningBank.query(task.description, { namespace: task.domain, limit: 3 }); // 2. Display patterns to user/agent console.log('Relevant past experiences:'); relevantPatterns.forEach((pattern, i) => { console.log(`${i + 1}. ${pattern.title} (${(pattern.score * 100).toFixed(0)}% match)`); console.log(` ${pattern.content}`); }); // 3. Ask user/agent to select or proceed with new approach const selected = await promptUser('Use which pattern? (0 for new)'); if (selected > 0) { return applyPattern(relevantPatterns[selected - 1], task); } else { return exploreNewApproach(task); } } ``` -------------------------------- ### Implementing a Basic Tool (TypeScript) Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md TypeScript example of an MCP server that lists a 'calculate_sum' tool and handles its invocation, returning the sum as text content. ```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"); }); ``` -------------------------------- ### Basic MCP server implementation in TypeScript Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Example of setting up an MCP server using the TypeScript SDK, handling resource requests, and connecting via stdio transport. ```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); ``` -------------------------------- ### Connect to MCP server Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Method to connect to an MCP server by validating the script path, starting a stdio client, and initializing the session. ```python async def connect_to_server(self, server_script_path: str): """Connect to an MCP server Args: server_script_path: Path to the server script (.py or .js) """ is_python = server_script_path.endswith('.py') is_js = server_script_path.endswith('.js') if not (is_python or is_js): raise ValueError("Server script must be a .py or .js file") command = "python" if is_python else "node" server_params = StdioServerParameters( command=command, args=[server_script_path], env=None ) stdio_transport = await self.exit_stack.enter_async_context(stdio_client(server_params)) self.stdio, self.write = stdio_transport self.session = await self.exit_stack.enter_async_context(ClientSession(self.stdio, self.write)) await self.session.initialize() # List available tools response = await self.session.list_tools() tools = response.tools print("\nConnected to server with tools:", [tool.name for tool in tools]) ``` -------------------------------- ### Create a card with full details Source: https://github.com/delorenj/mcp-server-trello/blob/main/examples/usage-examples.md Shows how to create a card with a detailed description, due date, start date, and labels using the add_card_to_list tool. ```javascript // Create a feature card with all details await use_mcp_tool({ server_name: "trello", tool_name: "add_card_to_list", arguments: { listId: "5e5a4b8f9e4b0d8123456790", name: "Implement OAuth 2.0 Authentication", description: "## Overview\nAdd OAuth 2.0 support for third-party integrations\n\n## Requirements\n- Support Google OAuth\n- Support GitHub OAuth\n- Implement refresh token flow\n\n## Technical Notes\n- Use passport.js for authentication\n- Store tokens securely in database", dueDate: "2025-02-15T17:00:00Z", start: "2025-02-01", labels: ["urgent", "backend", "security"] } }); ``` -------------------------------- ### Tool Documentation Format (api.md) Source: https://github.com/delorenj/mcp-server-trello/blob/main/_bmad-output/planning-artifacts/architecture.md Template for documenting tools in api.md, specifying the structure for tool name, description, parameters, returns, and an example. Use this format to maintain consistent tool documentation. ```markdown ### **Parameters:** - `paramName` (type, required/optional): Description - ... **Returns:** **Example:** - "Create a card on the 'Sprint Backlog' list..." ``` -------------------------------- ### Claude Desktop config with absolute path Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Use absolute paths in claude_desktop_config.json to avoid undefined working directory issues when Claude Desktop is started from anywhere. This example configures the filesystem server with an absolute path. ```json { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/username/data"] } ``` -------------------------------- ### Set up Python project with uv (MacOS/Linux) Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Creates a new uv project, sets up a virtual environment, installs mcp and httpx, removes the template file, and creates the package structure for the weather server. ```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 ``` -------------------------------- ### Send log message notification (TypeScript) Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Use this in a TypeScript MCP server to send a log message notification to the client. The example logs an info-level message 'Server started successfully'. This is for servers using any transport, not just stdio. ```typescript server.sendLoggingMessage({ level: "info", data: "Server started successfully", }); ``` -------------------------------- ### Set up Python project with uv (Windows) Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Creates a new uv project, sets up a virtual environment, installs mcp and httpx, removes the template file, and creates the package structure for the weather server on Windows. ```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 ``` -------------------------------- ### Send log message notification (Python) Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Use this in a Python MCP server to send a log message notification to the client. The example logs an info-level message 'Server started successfully'. This is for servers using any transport, not just stdio. ```python server.request_context.session.send_log_message( level="info", data="Server started successfully", ) ``` -------------------------------- ### Correct server path usage examples Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Shows how to specify the server path when running the client, including relative, absolute, and Windows path formats. Use forward slashes or escaped backslashes on Windows. ```bash # Relative path uv run client.py ./server/weather.py # Absolute path uv run client.py /Users/username/projects/mcp-server/weather.py # Windows path (either format works) uv run client.py C:/projects/mcp-server/weather.py uv run client.py C:\\projects\\mcp-server\\weather.py ``` -------------------------------- ### Main entry point for client Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Parses command-line arguments for the server script path, connects to the server, runs the chat loop, and ensures cleanup. Exits with usage message if no server script is provided. ```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()) ``` -------------------------------- ### Prepare Release with Release Checklist and Link Cards (JavaScript) Source: https://github.com/delorenj/mcp-server-trello/blob/main/examples/usage-examples.md Use this snippet to create a release card with a due date and labels, add a 10-item release checklist, then fetch all cards in the 'done' list and add a comment to each card that has a matching release label. The comment includes the release card's short link. ```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; } ``` -------------------------------- ### Basic client structure with imports and class initialization Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Python code to set up imports and create the MCPClient class with session, exit stack, and Anthropic client initialization. ```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 ``` -------------------------------- ### Run Python MCP server with uvx or pip Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Python-based MCP servers can be run using uvx (recommended) or installed and run with pip. The uvx command runs the server directly, while the pip approach requires installing the package first. ```bash # Using uvx uvx mcp-server-git # Using pip pip install mcp-server-git python -m mcp_server_git ``` -------------------------------- ### Vector Selector JSON output example Source: https://github.com/delorenj/mcp-server-trello/blob/main/_bmad/custom/src/workflows/enhancement-forge/data/sub-agents/vector-selector.md Example of the JSON-only output returned by the Vector Selector. Includes the chosen vector, confidence, dedupDistance, reasoning with evidence citations, and considered alternatives with rejection reasons. Confidence must be in [0.0, 1.0] and calibrated honestly; citations must be real from the discovery report. ```json { "vector": "UX/Ergonomics", "confidence": 0.82, "dedupDistance": 0.71, "reasoning": "GH scanner surfaced 4 issues themed around verbose multi-call patterns (issues 118, 124, 130, 142). Repo scanner found 7 TODOs in src/trello-client.ts about default board context. UX/Ergonomics weight is 1.0; cooldown is 1 run and last entry was 4 runs ago.", "evidenceCitations": ["src/trello-client.ts:142", "issue#118", "issue#124", "src/index.ts:67"], "consideredAlternatives": [ {"vector": "Observability", "rejectedBecause": "ledger entry 03 was Observability; cooldown_runs=2 still active"}, {"vector": "Feature Parity", "rejectedBecause": "discovery showed only 1 endpoint gap; signal density too low"} ] } ``` -------------------------------- ### get_active_board_info tool arguments Source: https://github.com/delorenj/mcp-server-trello/blob/main/README.md Arguments for getting information about the currently active board. Takes no arguments. ```typescript { s; name: 'get_active_board_info', arguments: {} } ``` -------------------------------- ### Initialize Server and Set Base URL Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Sets up the server instance and defines the base URL and user agent for the NWS API. ```python NWS_API_BASE = "https://api.weather.gov" USER_AGENT = "weather-app/1.0" server = Server("weather") ``` -------------------------------- ### Build the project with bun Source: https://github.com/delorenj/mcp-server-trello/blob/main/README.md Builds the project using the Bun build command. ```bash bun run build ``` -------------------------------- ### Basic Inspector command Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Run the Inspector directly via npx without installation. Replace with the server command to launch. ```bash npx @modelcontextprotocol/inspector ``` -------------------------------- ### Initialize NWS API Base, Schemas, and Server Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Sets up the NWS API base URL, user agent, Zod validation schemas, and creates 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: {}, }, } ); ``` -------------------------------- ### Momo Invocation Source: https://github.com/delorenj/mcp-server-trello/blob/main/_bmad/custom/src/workflows/product-discovery/steps/step-07-momo-handoff.md Command to invoke the momo skill with the operator's goal. This starts momo's preflight and per-ticket pipeline. ```text orchestrate {ticketId} ``` -------------------------------- ### Generate image with Ideogram MCP server Source: https://github.com/delorenj/mcp-server-trello/blob/main/README.md Example call to the Ideogram MCP server's generate_image tool. Returns an object with an image_url. ```typescript // Using ideogram-mcp-server { name: 'generate_image', arguments: { prompt: "A futuristic dashboard design with neon accents", aspect_ratio: "16:9" } } // Returns: { image_url: "https://..." } ``` -------------------------------- ### Add package entry point to __init__.py Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Defines the main entry point for the weather package, running the server's main function asynchronously. Exposes main and server at the package level. ```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'] ``` -------------------------------- ### Run Filesystem MCP Server Manually (Windows) Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Use this command to manually start the MCP filesystem server on Windows to verify it runs without errors. Replace 'username' with your actual username and provide absolute paths to directories you want to expose. ```bash npx -y @modelcontextprotocol/server-filesystem C:\Users\username\Desktop C:\Users\username\Downloads ``` -------------------------------- ### Example: Roots configuration in JSON Source: https://github.com/delorenj/mcp-server-trello/blob/main/docs/mcp-documentation.md Shows a typical MCP client exposing roots as a JSON object with an array of root objects, each containing a URI and a name. Use this to suggest the server focus on both a local repository and an API endpoint while keeping them logically separated. ```json { "roots": [ { "uri": "file:///home/user/projects/frontend", "name": "Frontend Repository" }, { "uri": "https://api.example.com/v1", "name": "API Endpoint" } ] } ```