A Model Context Protocol server for Toggl API integration
Project description
Toggl MCP Server
A Model Context Protocol (MCP) server that provides tools for interacting with the Toggl Track API v9. Built with FastMCP for simplicity and reliability, this server allows AI assistants to manage time tracking, projects, tags, and more through a standardized interface.
Features
The Toggl MCP server provides tools for:
- User & Workspace Management: Get user info, list workspaces and organizations
- Project Management: Create, list, update, and delete projects
- Time Tracking: Start/stop timers, create time entries, list time entries
- Bulk Operations: Create, update, and delete multiple time entries at once
- Tag Management: Create, list, update, and delete tags
- Client Management: Create and list clients
- Task Management: List and create project tasks (if enabled for the project)
📚 View Complete Tool Documentation - Comprehensive guide with all parameters, types, and examples
Installation
Install the package using uvx:
uvx toggl-mcp
Configuration
Environment Variables
The server requires the following environment variables:
TOGGL_API_TOKEN(required): Your Toggl API tokenTOGGL_WORKSPACE_ID(optional): Default workspace ID to use for operations
Getting Your API Token
- Log in to your Toggl Track account
- Go to Profile Settings
- Scroll down to "API Token" section
- Copy your API token
Finding Your Workspace ID
- Use the
toggl_list_workspacestool after setting up the server - Note the ID of the workspace you want to use as default
Usage with Cursor
Add the following to your Cursor MCP settings:
- Open Cursor Settings (Cmd/Ctrl + ,)
- Navigate to Features → Model Context Protocol → Edit Config
- Add this configuration:
{
"toggl-mcp": {
"command": "python3",
"args": ["-m", "toggl_mcp"],
"env": {
"TOGGL_API_TOKEN": "your_api_token_here",
"TOGGL_WORKSPACE_ID": "optional_default_workspace_id"
}
}
}
- Restart Cursor for changes to take effect
Usage with Claude Desktop
Add the following to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"toggl-mcp": {
"command": "uvx",
"args": ["toggl-mcp"],
"env": {
"TOGGL_API_TOKEN": "your_api_token_here",
"TOGGL_WORKSPACE_ID": "optional_default_workspace_id"
}
}
}
}
Available Tools
User & Workspace Tools
toggl_get_user: Get current user informationtoggl_list_workspaces: List all available workspacestoggl_list_organizations: List user's organizations
Project Tools
toggl_list_projects: List all projects in a workspacetoggl_create_project: Create a new project- Parameters:
name(required),workspace_id,client_id,color,is_private
- Parameters:
Time Entry Tools
toggl_list_time_entries: List time entries within a date range- Parameters:
start_date,end_date(defaults to last 7 days)
- Parameters:
toggl_get_current_timer: Get the currently running time entrytoggl_start_timer: Start a new timer- Parameters:
description(required),workspace_id,project_id,tags,billable
- Parameters:
toggl_stop_timer: Stop a running time entry- Parameters:
time_entry_id(required),workspace_id
- Parameters:
toggl_create_time_entry: Create a completed time entry- Parameters:
description,start,stop(all required),workspace_id,project_id,tags,billable
- Parameters:
Tag Tools
toggl_list_tags: List all tags in a workspacetoggl_create_tag: Create a new tag- Parameters:
name(required),workspace_id
- Parameters:
Client Tools
toggl_list_clients: List all clients in a workspacetoggl_create_client: Create a new client- Parameters:
name(required),workspace_id
- Parameters:
Bulk Operation Tools
toggl_bulk_create_time_entries: Create multiple time entries at once- Parameters:
time_entries(array, required),workspace_id
- Parameters:
toggl_bulk_update_time_entries: Update multiple time entries at once- Parameters:
time_entry_ids(array, required),updates(object, required),workspace_id
- Parameters:
toggl_bulk_delete_time_entries: Delete multiple time entries at once- Parameters:
time_entry_ids(array, required),workspace_id
- Parameters:
Project Task Tools
toggl_list_project_tasks: List tasks for a project (only if tasks are enabled)- Parameters:
project_id(required),workspace_id
- Parameters:
toggl_create_project_task: Create a task for a project- Parameters:
project_id(required),name(required),workspace_id
- Parameters:
Example Usage
Here are some example prompts you can use with Claude:
- "Show me my Toggl workspaces"
- "List my time entries from the last week"
- "Start a timer for 'Working on documentation' in my default workspace"
- "Create a new project called 'Website Redesign' with the client 'Acme Corp'"
- "What timer am I currently tracking?"
- "Stop the current timer"
- "Create a tag called 'billable'"
- "Show me all projects in workspace 123456"
Troubleshooting
"ModuleNotFoundError: No module named 'mcp'"
This error means the dependencies aren't installed. Fix it by:
# Option 1: Install the package
pip install toggl-mcp
# Option 2: Install from source (for development)
pip install -e .
Cursor shows "No tools available"
- Make sure you're using
python3in the command, notuvx - Check that the API token is correctly set in the env section
- Restart Cursor after making configuration changes
"TOGGL_API_TOKEN environment variable not set"
The token needs to be in the MCP configuration's env section, not your shell environment.
Development
Project Structure
toggl-mcp/
├── toggl_mcp/ # Package directory
│ ├── __init__.py # Package initialization
│ ├── main.py # Main MCP server entry point
│ ├── toggl_client.py # Toggl API client implementation
│ └── tools.py # Tool definitions and handlers
├── pyproject.toml # Project configuration
└── README.md # This file
Running Locally
- Clone the repository
- Install dependencies:
pip install -e . - Set environment variables:
export TOGGL_API_TOKEN=your_api_token_here export TOGGL_WORKSPACE_ID=your_workspace_id # optional
- Run the server:
python main.py
Adding New Tools
To add new tools:
- Add the API method to
toggl_client.py - Define the tool schema in
tools.pyin theget_all_tools()function - Add the handler logic in
tools.pyin thehandle_tool_call()function
Testing
The project includes comprehensive test scripts:
-
Test Connection (
test_connection.py): Verify API token and basic connectivitypython test_connection.py -
Test All Operations (
test_all_operations.py): Test all API operations directlypython test_all_operations.py -
Test MCP Tools (
test_mcp_tools.py): Test all tools through the MCP interfacepython test_mcp_tools.py
All test scripts will create temporary data (projects, time entries, etc.) and clean up after themselves.
API Reference
This server implements tools for the Toggl Track API v9.
License
MIT License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file toggl_mcp-0.1.5.tar.gz.
File metadata
- Download URL: toggl_mcp-0.1.5.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6a46e1eb6ee65d6dd5ffc6b612e8e936af4b765c63b3f456b0d17eaeca5f791
|
|
| MD5 |
9cbeda37f52db946d3175ee3388279fd
|
|
| BLAKE2b-256 |
6b4e3dd36dacb2c3c2ea22564cc19b671d1d925f1d03fa2b1c314abcde3dfa32
|
File details
Details for the file toggl_mcp-0.1.5-py3-none-any.whl.
File metadata
- Download URL: toggl_mcp-0.1.5-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35d33be62bcbe9e0ddcdd71343058179bd9576476014d1df1c43fee58e42380a
|
|
| MD5 |
0d73fcf715ba1bf0ca6967753c7d80bb
|
|
| BLAKE2b-256 |
2b26e3681dc00ca1df8acd6aab75b1cd2bec16efb2464aa24b8c33ceb137b23f
|