Skip to main content

Dendrite MCP Tools

Dendrite provides MCP (Model Context Protocol) tools for AI assistants to search and understand your codebase.

Available Tools

Semantic search across your codebase.
{
  "name": "dendrite_search",
  "arguments": {
    "query": "user authentication flow",
    "repository": "acme-api",
    "limit": 10
  }
}
Response:
{
  "results": [
    {
      "file": "app/controllers/sessions_controller.rb",
      "lines": "15-28",
      "relevance": 0.92,
      "snippet": "def create\n  user = User.find_by(email: params[:email])...",
      "summary": "Session creation with password authentication"
    }
  ]
}

dendrite_explain

Get an explanation of a file or function.
{
  "name": "dendrite_explain",
  "arguments": {
    "repository": "acme-api",
    "file": "app/services/payment_service.rb",
    "function": "process"
  }
}
Response:
{
  "explanation": {
    "summary": "Processes a payment through Stripe",
    "steps": [
      "1. Validates payment amount and currency",
      "2. Creates Stripe PaymentIntent",
      "3. Confirms payment with provided method",
      "4. Records transaction in database"
    ],
    "inputs": ["amount", "currency", "payment_method_id"],
    "outputs": ["Transaction record or raises PaymentError"],
    "dependencies": ["Stripe API", "Transaction model"]
  }
}

dendrite_diagram

Generate a diagram for a module or system.
{
  "name": "dendrite_diagram",
  "arguments": {
    "repository": "acme-api",
    "type": "class",
    "scope": "app/models"
  }
}
Response:
{
  "diagram": {
    "type": "mermaid",
    "code": "classDiagram\n    User \"1\" --> \"*\" Order\n    Order \"1\" --> \"*\" LineItem..."
  }
}

Example Conversations

User: “How does authentication work in the API?” Assistant uses: dendrite_search with query: "authentication API" Response: “Based on the codebase, authentication uses JWT tokens. The SessionsController#create validates credentials and returns a token, which is then verified by the Authenticatable concern on protected endpoints.”
User: “Explain the payment flow” Assistant uses: dendrite_explain with file: "app/services/payment_service.rb" Response: “The payment flow works in 4 steps: First it validates the amount, then creates a Stripe PaymentIntent, confirms it with the customer’s payment method, and finally records the transaction in your database.”
User: “Show me the model relationships” Assistant uses: dendrite_diagram with type: "class", scope: "app/models" Response: “Here’s the class diagram showing your model relationships:” followed by the Mermaid diagram.

Setup

Add Dendrite MCP to your Claude Desktop or Cursor configuration:
{
  "mcpServers": {
    "brainzlab-dendrite": {
      "command": "npx",
      "args": ["-y", "@brainzlab/mcp-server"],
      "env": {
        "BRAINZLAB_SECRET_KEY": "your-secret-key",
        "BRAINZLAB_PRODUCTS": "dendrite"
      }
    }
  }
}