FreeAgent MCP server

Integrates with FreeAgent API to enable time tracking management, including timeslip and timer operations for project tracking and reporting.
Back to servers
Setup instructions
Provider
Mark Pitt
Release date
Mar 05, 2025
Language
TypeScript
Stats
1 star

The FreeAgent MCP Server enables Claude to interact with your FreeAgent account for time tracking, including managing timeslips and timers. This integration works through the Model Context Protocol (MCP), giving Claude direct access to your time-tracking data.

Prerequisites

  • Node.js 18+ (for direct Node.js usage)
  • Docker & Docker Compose (for containerized usage)
  • A FreeAgent account with API access
  • OAuth credentials from the FreeAgent Developer Dashboard

Installation Options

Using Node.js Directly

  1. Clone the repository:
git clone https://github.com/yourusername/freeagent-mcp.git
cd freeagent-mcp
  1. Install dependencies:
npm install
  1. Set up OAuth tokens:
# Set your FreeAgent credentials
export FREEAGENT_CLIENT_ID="your_client_id"
export FREEAGENT_CLIENT_SECRET="your_client_secret"

# Run the OAuth setup script
node scripts/get-oauth-tokens.js

Using Docker

  1. Clone the repository:
git clone https://github.com/yourusername/freeagent-mcp.git
cd freeagent-mcp
  1. Create your environment file:
cp .env.example .env
# Edit .env with your FreeAgent credentials
  1. Build Docker image:
docker build -t freeagent-mcp .

Configuration

Add the server to your MCP settings file (typically located at %APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json):

For Node.js Installation:

{
  "mcpServers": {
    "freeagent": {
      "command": "node",
      "args": ["path/to/freeagent-mcp/build/index.js"],
      "env": {
        "FREEAGENT_CLIENT_ID": "your_client_id",
        "FREEAGENT_CLIENT_SECRET": "your_client_secret",
        "FREEAGENT_ACCESS_TOKEN": "your_access_token",
        "FREEAGENT_REFRESH_TOKEN": "your_refresh_token"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

For Docker Installation:

{
  "mcpServers": {
    "freeagent": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e", "FREEAGENT_CLIENT_ID",
        "-e", "FREEAGENT_CLIENT_SECRET",
        "-e", "FREEAGENT_ACCESS_TOKEN",
        "-e", "FREEAGENT_REFRESH_TOKEN",
        "freeagent-mcp"
      ],
      "env": {
        "FREEAGENT_CLIENT_ID": "your_client_id",
        "FREEAGENT_CLIENT_SECRET": "your_client_secret",
        "FREEAGENT_ACCESS_TOKEN": "your_access_token",
        "FREEAGENT_REFRESH_TOKEN": "your_refresh_token"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Using the MCP Server with Claude

Once configured, Claude can access several tools to interact with your FreeAgent account:

Listing and Filtering Timeslips

Claude can retrieve timeslips with various filters:

{
  "from_date": "2024-01-01",      // Start date (YYYY-MM-DD)
  "to_date": "2024-03-04",        // End date (YYYY-MM-DD)
  "updated_since": "2024-03-04T12:00:00Z",  // ISO datetime
  "view": "all",                  // "all", "unbilled", or "running"
  "user": "https://api.freeagent.com/v2/users/123",
  "task": "https://api.freeagent.com/v2/tasks/456",
  "project": "https://api.freeagent.com/v2/projects/789",
  "nested": true                  // Include nested resources
}

Creating New Timeslips

Claude can create new timeslips with the following parameters:

{
  "task": "https://api.freeagent.com/v2/tasks/123",
  "user": "https://api.freeagent.com/v2/users/456",
  "project": "https://api.freeagent.com/v2/projects/789",
  "dated_on": "2024-03-04",
  "hours": "1.5",
  "comment": "Optional comment"
}

Managing Timers

Claude can start and stop timers with a simple command:

// Start timer
{
  "id": "123"
}

// Stop timer
{
  "id": "123"
}

Features

The FreeAgent MCP Server provides these key capabilities:

  • List and filter timeslips with optional nested data
  • Create new timeslips with required fields
  • Update existing timeslips
  • Start and stop time tracking timers
  • Delete timeslips when needed
  • Automatic OAuth token refresh for continued access
  • Comprehensive error handling to troubleshoot issues

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "freeagent" '{"command":"node","args":["path/to/freeagent-mcp/build/index.js"],"env":{"FREEAGENT_CLIENT_ID":"your_client_id","FREEAGENT_CLIENT_SECRET":"your_client_secret","FREEAGENT_ACCESS_TOKEN":"your_access_token","FREEAGENT_REFRESH_TOKEN":"your_refresh_token"},"disabled":false,"autoApprove":[]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "freeagent": {
            "command": "node",
            "args": [
                "path/to/freeagent-mcp/build/index.js"
            ],
            "env": {
                "FREEAGENT_CLIENT_ID": "your_client_id",
                "FREEAGENT_CLIENT_SECRET": "your_client_secret",
                "FREEAGENT_ACCESS_TOKEN": "your_access_token",
                "FREEAGENT_REFRESH_TOKEN": "your_refresh_token"
            },
            "disabled": false,
            "autoApprove": []
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "freeagent": {
            "command": "node",
            "args": [
                "path/to/freeagent-mcp/build/index.js"
            ],
            "env": {
                "FREEAGENT_CLIENT_ID": "your_client_id",
                "FREEAGENT_CLIENT_SECRET": "your_client_secret",
                "FREEAGENT_ACCESS_TOKEN": "your_access_token",
                "FREEAGENT_REFRESH_TOKEN": "your_refresh_token"
            },
            "disabled": false,
            "autoApprove": []
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later