Skip to main content
Glama
guglielmo

TMetric MCP Server

by guglielmo

TMetric MCP Server

Minimal Model Context Protocol server for TMetric time tracking integration.

Features

  • List TMetric projects

  • Start/stop timers

  • Check current timer status

  • GitLab issue integration

  • Delete time entries

Related MCP server: Tempo MCP Server

Installation

npm install
npm run build

Configuration

Set your TMetric API token:

export TMETRIC_API_TOKEN="your_token_here"

Usage with Claude Code

Add the TMetric MCP server using the claude mcp add command. You can install at different scopes:

User Scope (Global - All Projects)

Available across all projects for your user:

One-liner:

claude mcp add --scope user tmetric-mcp --env TMETRIC_API_TOKEN=your_token_here -- node /path/to/tmetric-mcp-server/build/index.js

Interactive:

claude mcp add tmetric-mcp --scope user

When prompted, configure:

  • Command: node

  • Args: /path/to/tmetric-mcp-server/build/index.js

  • Environment variables: TMETRIC_API_TOKEN=your_token_here

Project Scope (Specific Project)

Available only in the current project directory:

One-liner:

claude mcp add --scope project tmetric-mcp --env TMETRIC_API_TOKEN=your_token_here -- node /path/to/tmetric-mcp-server/build/index.js

Interactive:

claude mcp add tmetric-mcp --scope project

When prompted, configure with the same settings as above.

Local Scope (Current Directory)

Available only in the current working directory:

One-liner:

claude mcp add --scope local tmetric-mcp --env TMETRIC_API_TOKEN=your_token_here -- node /path/to/tmetric-mcp-server/build/index.js

Interactive:

claude mcp add tmetric-mcp --scope local

When prompted, configure with the same settings as above.

Alternative: Using npx (from GitHub)

You can run directly from GitHub with npx (no clone or build needed):

One-liner:

claude mcp add --scope user tmetric-mcp --env TMETRIC_API_TOKEN=your_token_here -- npx -y github:guglielmo/tmetric-minimal-mcp

Interactive:

claude mcp add tmetric-mcp --scope user

When prompted, configure:

  • Command: npx

  • Args: -y github:guglielmo/tmetric-minimal-mcp

  • Environment variables: TMETRIC_API_TOKEN=your_token_here

Alternative: Using npx (from local path)

If you've cloned the repository locally:

One-liner:

claude mcp add --scope user tmetric-mcp --env TMETRIC_API_TOKEN=your_token_here -- npx -y /path/to/tmetric-mcp-server

Interactive:

claude mcp add tmetric-mcp --scope user

When prompted, configure:

  • Command: npx

  • Args: -y /path/to/tmetric-mcp-server

  • Environment variables: TMETRIC_API_TOKEN=your_token_here

Available Tools

list_tmetric_projects()

Get list of available projects.

get_current_timer()

Check if a timer is running.

start_timer(project_id, task_name, task_url?)

Start tracking time on a project/task.

stop_timer()

Stop current timer and return time spent.

delete_time_entry(entry_id?)

Delete a time entry.

Development

# Watch mode
npm run watch

# Run directly with tsx
npm run dev

Testing

Running Tests

# Run all tests once
npm test

# Run tests in watch mode (re-runs on file changes)
npm run test:watch

# Run tests with coverage report
npm run test:coverage

# Run tests with interactive UI
npm run test:ui

Test Coverage

The project has comprehensive test coverage with:

  • 100% statement coverage across all modules

  • 97%+ branch coverage for edge cases

  • Unit tests for all utility functions (utils.ts)

  • Full integration tests for TMetric API client (tmetric-client.ts)

  • Mocked HTTP requests using nock for reliable testing

See TESTING.md for detailed information about the testing strategy and how to write new tests.

Manual Testing

Test the MCP server with Claude Code by starting a conversation and using commands like:

  • "List my TMetric projects"

  • "Start timer on project 12345 for Issue #123: Fix bug"

  • "What am I working on?"

  • "Stop the timer"

Troubleshooting

"TMETRIC_API_TOKEN is required"

Make sure you've set the environment variable with your API token.

"Failed to initialize TMetric client"

Check that your API token is valid and you have network access to TMetric.

"Timer already running"

This is expected behavior. Stop the current timer before starting a new one.

Used By

This MCP server is a dependency for the following Claude Code skills:

  • issue-time-tracking - Automates synchronized issue status tracking and time logging across GitLab/GitHub and TMetric

License

MIT

Available Tools

5 tools
delete_time_entryA

Delete a time entry. Mode "current" deletes active timer only, "last" deletes most recent entry (with 5-min safety window).

ParametersJSON Schema
NameRequiredDescriptionDefault
modeNoDeletion mode: "current" for active timer only, "last" for most recent entrycurrent

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It adds value by specifying mode-specific behavior and the 5-minute safety window, but does not mention reversibility, failure conditions (e.g., no active timer), or permission requirements. The safety window is a useful behavioral detail, but overall transparency is incomplete.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the main action, and every word adds value. It is concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter, no-output-schema tool, the description is largely complete. It explains the two modes and a safety feature. However, it could mention what happens when no active timer exists or when the most recent entry is older than the safety window, which would make it more complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, and the description adds no additional meaning beyond the schema. The mode parameter is fully documented in the schema, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool deletes a time entry and explains the two modes. It distinguishes itself from sibling tools by focusing on deletion, with specific verbs and resource scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains the two modes and their use cases, but does not explicitly state when to use this tool over alternatives or mention exclusions. Usage context is implied by the name and description, but no direct comparison to siblings is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_current_timerA

Check if a timer is currently running and get its details

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. It correctly implies a read-only operation ('check', 'get'), but does not mention error handling, return value format, or behavior when no timer is running. This is a noticeable gap for a tool with no other behavioral documentation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that is concise and front-loaded. It communicates the essential information without redundant words or unnecessary detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description provides adequate context for its primary purpose. However, it could be more complete by indicating what the tool returns when no timer is running, but this is not critical for a straightforward getter.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and the input schema is empty. The description is not required to explain parameter semantics, and the baseline for 0-param tools is 4, which is appropriate here.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verbs 'check' and 'get' with the resource 'current timer', clearly distinguishing it from sibling tools like start_timer and stop_timer. It precisely states the tool's function: determining if a timer is running and retrieving its details.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use the tool—to check the current timer status—but does not explicitly state when not to use it or name alternative tools. However, the context is unambiguous given the sibling tool names, so it earns a 4 rather than a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_tmetric_projectsA

Get list of available TMetric projects for time tracking

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full transparency burden. The verb 'Get list' implies read-only behavior, and 'available' adds a qualifier, but it does not disclose response format, pagination, or what determines availability. Minimal behavioral context beyond the action itself.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with no superfluous words. It front-loads the verb and resource, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple (zero parameters, no output schema), but the description covers the essential purpose. It could be more complete by specifying the return structure or indicating when to run it relative to timer operations, but it is adequate for basic invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool accepts zero parameters, so the schema is fully complete. No parameter explanation is needed, and the baseline score for 0 parameters is 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'Get list' and identifies the resource as 'available TMetric projects', clearly stating what the tool returns. This distinguishes it from sibling tools that manage timers and time entries.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for time tracking ('for time tracking') but does not explicitly state when to use this tool versus alternatives or mention any prerequisites. It is not misleading, but guidance is minimal.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

start_timerA

Start time tracking on a project and task. Will fail if another timer is already running.

ParametersJSON Schema
NameRequiredDescriptionDefault
task_urlNoOptional GitLab issue URL for integration
task_nameYesName of the task (e.g., "Issue #123: Fix bug")
project_idYesTMetric project ID

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the burden of behavioral disclosure. It discloses one key behavior—the failure condition when another timer is running—but does not cover other aspects like success return values, permissions, or idempotency. This adds some context but lacks depth.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, consisting of two sentences with no filler. It front-loads the primary purpose and includes one critical behavioral note, making every word meaningful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the core purpose and failure condition, which is essential for a start_timer tool. However, since there is no output schema, it does not explain what happens on success (e.g., return value), and it does not reference related tools or prerequisites like checking the current timer. It is adequate but could be more complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage for all 3 parameters, so the schema already provides parameter semantics. The description adds no additional parameter details beyond mentioning 'project' and 'task,' which maps to existing schema fields. This aligns with the baseline score of 3 for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'Start' and clearly identifies the resource as 'time tracking on a project and task.' This directly conveys the tool's action and distinguishes it from siblings like stop_timer, get_current_timer, and delete_time_entry.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use the tool (to start tracking) and includes a precondition ('Will fail if another timer is already running'). However, it does not explicitly mention alternatives or suggest checking get_current_timer first, leaving the usage guidance mainly implied rather than explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

stop_timerA

Stop the currently running timer and return time spent

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A3.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the primary action (stop timer) and return value, but does not disclose edge-case behavior, such as what happens if no timer is running, whether the action is destructive/canceling any pending time entry, or the format of the 'time spent' return value. This is a significant gap for a mutation tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that directly states the action and return value with no extraneous content. Every word contributes to meaning, making it appropriately sized and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with no parameters and no output schema, the description covers the core function and return value, but lacks completeness regarding error cases and behavioral details beyond the primary action. It is minimally viable but does not fully inform the agent about potential failure modes or nuances.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters and the schema is empty, so the description does not need to explain parameter semantics. The baseline of 4 applies because there are no parameters to describe, and the description adds no redundant parameter information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Stop') and resource ('currently running timer') with a clear outcome ('return time spent'). It distinguishes itself from siblings like start_timer and get_current_timer by denoting the opposite action (stopping vs. starting) and the addition of returning elapsed time.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The usage context is implied: it is for stopping the currently running timer. However, there is no explicit guidance on when to use it versus alternatives (e.g., when not to use, or that it requires an active timer). The presence of sibling tools like start_timer and get_current_timer provides context, but no explicit exclusions are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 5 tool updatesv2.0.0
    • First observeddelete_time_entry
    • First observedget_current_timer
    • First observedlist_tmetric_projects
    • First observedstart_timer
    • First observedstop_timer

TDQS

A3.9/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: listing projects, checking the current timer, starting, stopping, and deleting time entries. There is no overlap or ambiguity between them.

Naming Consistency4/5

Most tools follow a consistent verb_noun pattern (list, get, start, stop, delete). The only inconsistency is 'list_tmetric_projects' including the server name, unlike the others, which is minor and doesn't harm readability.

Tool Count5/5

With 5 tools, the server is well-scoped for its purpose of time tracking. Each tool covers a core operation without unnecessary bloat, making it easy to navigate.

Completeness3/5

The server covers the basic timer lifecycle (start, stop, check, delete) and project listing, but lacks the ability to list past time entries or fetch tasks for a project, which are common needs. These gaps could hinder an agent from effectively managing time tracking.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers