> ## Documentation Index
> Fetch the complete documentation index at: https://docs.campfire.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Integration with Model Context Protocol

> Connect Campfire to your favorite AI tools using MCP

<Info>MCP (Model Context Protocol) allows you to access Campfire's APIs through AI tools like Cursor, VS Code, Claude Desktop, and others.</Info>

## What is MCP?

The Model Context Protocol (MCP) is an open standard that enables AI applications to securely connect to external data sources and tools. Campfire exposes an MCP server so you can:

* Query your accounting data through AI assistants
* Generate reports using natural language
* Analyze financial trends with AI-powered insights
* Automate accounting workflows through AI tools

## How the MCP Server Works

The MCP server provides AI tools that map directly to Campfire API endpoints. When an AI assistant uses a tool, the MCP server:

1. Authenticates your request using your API token
2. Calls the corresponding Campfire API endpoint with your credentials
3. Returns the response to the AI assistant

Your token is sent with every API tool call so results stay scoped to your organization.

## Available Tools

The MCP server provides 12 tools that map directly to Campfire API endpoints:

<AccordionGroup>
  <Accordion title="Core Accounting">
    * **Chart of Accounts**: Retrieve chart of accounts with optional filtering by type, subtype, or search query
    * **Transactions**: Search and filter general ledger transactions with support for entity, account, vendor, department, tag, and date range filters
  </Accordion>

  <Accordion title="Company Data">
    * **Entities**: Retrieve chart entities (parent companies, subsidiaries, locations)
    * **Vendors**: Retrieve vendor/payee directory with contact details and status
    * **Departments**: Retrieve department hierarchy (cost centers, business units)
    * **Tags**: Retrieve transaction tags (custom dimensions) used for analytics
  </Accordion>

  <Accordion title="Financial Reports">
    * **Income Statement**: Generate profit & loss statements for specified periods with configurable cadence (monthly, quarterly, yearly)
    * **Balance Sheet**: Generate balance sheet showing assets, liabilities, and equity
    * **Cash Flow Statement**: Generate cash flow by operating, investing, and financing activities
  </Accordion>

  <Accordion title="Budgeting & Revenue">
    * **Budgets**: Retrieve budget records with entity and time-period metadata
    * **Contracts**: Retrieve revenue recognition contracts with performance obligations
    * **Aging Report**: Generate AP/AR aging reports with age bucket breakdowns
  </Accordion>
</AccordionGroup>

<Info>All tools return data scoped to your organization based on your authentication token.</Info>

## How the tools are used

Your AI tool maps your question to the right Campfire API using the OpenAPI schema. You ask in natural language; the AI translates your request into the appropriate endpoint and parameters (filters, date ranges, pagination). Results are scoped to the organization tied to your API token.

For full request parameters (filters, date formats, pagination), see the [API reference](/api-reference) for each endpoint.

## Getting Started

<Steps>
  <Step title="Configure Your AI Tool">
    Add the Campfire MCP server to your AI tool's configuration:

    <Tabs>
      <Tab title="Cursor">
        Open the Command Palette (Cmd+Shift+P), select **MCP: Open Settings**, and add:

        ```json theme={null}
        {
          "mcpServers": {
            "Campfire": {
              "url": "https://api.meetcampfire.com/mcp"
            }
          }
        }
        ```
      </Tab>

      <Tab title="Claude Desktop">
        In Claude Desktop, go to **Settings** > **Connectors** > **Search for Campfire**, and click on Connect.
      </Tab>

      <Tab title="VS Code">
        Create or edit `.vscode/mcp.json` in your workspace:

        ```json theme={null}
        {
          "servers": {
            "Campfire": {
              "url": "https://api.meetcampfire.com/mcp"
            }
          }
        }
        ```
      </Tab>
    </Tabs>
  </Step>

  <Step title="Restart Your AI Tool">
    Restart your AI tool to load the new MCP configuration.
  </Step>

  <Step title="Start Querying">
    You can now ask your AI assistant questions about your Campfire data:

    * "Show me the income statement for Q1 2024"
    * "Find all transactions from vendor ABC Corp in the last month"
    * "What are my top 10 expense accounts by amount?"
    * "List all departments in my organization"
    * "Show me all active contracts"
  </Step>
</Steps>

## Example Queries

Here are some example queries you can try with your AI tool:

<AccordionGroup>
  <Accordion title="Chart of Accounts">
    ```
    Get all accounts of type ASSET
    ```

    ```
    Find accounts with "cash" in the name
    ```

    ```
    Show me all bank accounts
    ```
  </Accordion>

  <Accordion title="Transactions">
    ```
    Find transactions from the last 30 days
    ```

    ```
    Show me all transactions for vendor ABC Corp
    ```

    ```
    Get transactions for the Marketing department
    ```

    ```
    Find all transactions over $1000 in December 2023
    ```
  </Accordion>

  <Accordion title="Company Data">
    ```
    List all vendors with names containing "Tech"
    ```

    ```
    Show me all departments
    ```

    ```
    Get all entities in my organization
    ```

    ```
    Find tags related to "Marketing"
    ```
  </Accordion>

  <Accordion title="Financial Reports">
    ```
    Generate income statement for Q1 2024
    ```

    ```
    Show me balance sheet for December 2023
    ```

    ```
    Get cash flow statement for the last 6 months
    ```

    ```
    Create a monthly income statement for 2023
    ```
  </Accordion>

  <Accordion title="Budgets, Contracts & Aging">
    ```
    Show me all budgets for our main entity
    ```

    ```
    List all active contracts
    ```

    ```
    Get accounts payable aging report
    ```

    ```
    Show me AR aging as of today
    ```
  </Accordion>
</AccordionGroup>

<Note>The AI assistant will translate your natural language queries into the appropriate API calls with the correct parameters. Results are automatically scoped to your organization.</Note>

## Security & Privacy

<Warning>Your API token provides full access to your Campfire data. Keep it secure and never share it publicly.</Warning>

* **Authentication**: All requests require a valid API token
* **Data scope**: Results are scoped to the organization associated with your API token
* **Data privacy**: Your data is only accessed when you explicitly request it through the AI tool
* **Secure storage**: AI tools securely store your token locally for future requests

## Troubleshooting

<AccordionGroup>
  <Accordion title="401 Unauthorized">
    If you receive authentication errors:

    * Verify your API token is correct
    * Check that your token hasn't expired
    * Ensure the authorization header is properly configured in your MCP settings
  </Accordion>

  <Accordion title="Tools not appearing">
    If Campfire tools don't show up in your AI assistant:

    * Restart your AI tool completely
    * Verify the MCP server URL is correct in your configuration
    * Check that your API token is valid
  </Accordion>

  <Accordion title="Need help?">
    Contact our support team at [support@campfire.com](mailto:support@campfire.com) for assistance with MCP configuration or troubleshooting.
  </Accordion>
</AccordionGroup>
