tsheets-sage-mcp
Formats TSheets timesheet and project data into Sage 100 Contractor-compatible reports and exports them as text, Markdown, CSV, DOCX, or PDF.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
TSheets MCP Server
MCP (Model Context Protocol) server for querying TSheets timesheet and project data from Claude Desktop. Fetch employee hours, notes, and photo attachments by project and date range; format results for Sage 100 Contractor; and optionally cache history in a local SQLite database for faster project lookups.
Features
TSheets integration — OAuth 2.0 auth, timesheets by date range and jobcode, employees, hierarchical jobcodes, project notes, and file attachments
Fast vs detailed reports — aggregated Project Report summaries or full entry-level detail (hours, notes, photos)
Jobcode search — find projects/tasks by name, numeric ID, or short code across the full hierarchy path
Sage 100 Contractor export — transform timesheets to Sage format; export as text, markdown, CSV, DOCX, or PDF
Local SQLite cache — sync recent or historical data for offline-style project history queries
Claude Desktop (stdio MCP) — natural-language queries through the MCP tools listed below
Related MCP server: 7Pace-Connector
Requirements
Node.js and npm (native build tools required for
better-sqlite3)A TSheets account with the API add-on enabled
Claude Desktop (for MCP usage)
Note: This repo does not pin a Node
enginesrange. Use a current Node LTS. On corporate networks, scripts already setNODE_OPTIONS=--use-system-cato help with TLS/certificate issues.
Quick start
1. Clone and install
git clone https://github.com/cykj40/Tsheets-MCP.git
cd Tsheets-MCP
npm install2. Create a TSheets API application
Log into TSheets
Go to Feature Add-ons → Manage Add-ons
Install the API add-on if needed
Add a new application and set:
Name: e.g.
MCP ServerOAuth Redirect URI:
http://localhost:3000/oauth/callback
Save and copy the Client ID and Client Secret
3. Configure environment
Create a .env file in the project root (there is currently no committed .env.example):
TSHEETS_CLIENT_ID=your_client_id
TSHEETS_CLIENT_SECRET=your_client_secret
TSHEETS_REDIRECT_URI=http://localhost:3000/oauth/callback
TOKEN_FILE_PATH=.tokens.jsonOptional:
# Absolute or relative path to the SQLite DB file.
# Default when unset: <project>/data/tsheets-cache.db
TSHEETS_DB_PATH=./data/tsheets-cache.dbDo not commit .env, .tokens.json, or *.db files (they are gitignored).
4. Authenticate
npm run authThis starts a local OAuth callback server (default port 3000), opens the TSheets authorize URL, and writes tokens to TOKEN_FILE_PATH.
If the browser does not open, copy the URL printed in the terminal. If token exchange fails on a corporate network, ensure NODE_OPTIONS=--use-system-ca is set (the npm scripts already include this).
5. Verify the TSheets connection
Use the dedicated connectivity script (not npm test, which runs Vitest unit tests):
# Recent timesheets
npm run test:tsheets
# List employees
npm run test:tsheets -- --users
# List jobcodes / projects
npm run test:tsheets -- --jobs
# Dump users, jobs, and recent timesheets
npm run test:tsheets -- --dump6. Build and run the MCP server
npm run build
npm startDevelopment (watch mode):
npm run devThe server speaks MCP over stdio (StdioServerTransport). It is meant to be launched by an MCP host such as Claude Desktop, not used as an HTTP API.
7. Connect Claude Desktop
Edit claude_desktop_config.json:
OS | Typical path |
Windows |
|
macOS |
|
Example (adjust paths to your machine):
{
"mcpServers": {
"tsheets": {
"command": "node",
"args": [
"/ABSOLUTE/PATH/TO/Tsheets-MCP/dist/index.js"
],
"env": {
"NODE_OPTIONS": "--use-system-ca",
"TSHEETS_CLIENT_ID": "your_client_id",
"TSHEETS_CLIENT_SECRET": "your_client_secret",
"TSHEETS_REDIRECT_URI": "http://localhost:3000/oauth/callback",
"TOKEN_FILE_PATH": "/ABSOLUTE/PATH/TO/Tsheets-MCP/.tokens.json"
}
}
}
}On Windows, use escaped backslashes in JSON paths (e.g. C:\\Users\\YOUR_USER\\...\\dist\\index.js).
Restart Claude Desktop after saving. Then try:
Get timesheet data for all projects from last weekConfiguration reference
Variable | Required | Purpose |
| Yes | TSheets OAuth client ID |
| Yes | TSheets OAuth client secret |
| Yes | Must match the app redirect URI (default in docs: |
| Yes | Path to stored OAuth tokens (e.g. |
| No | Path to SQLite cache file; default |
Token refresh uses a file lock (TOKEN_FILE_PATH + .lock) so concurrent processes do not rotate the refresh token at the same time.
Available MCP tools
Tool | Description |
| Search jobcodes by name, ID, or short code (prefer this before filtering reports by project name) |
| Fast aggregated hours by user/jobcode (Project Report API) |
| Detailed entries: hours, notes, attachments |
| Project notes and file attachments ( |
| Jobcode/project metadata, notes, and cached timesheet history by cost code (SQLite-first; syncs on miss) |
| Convert a raw project report into Sage 100 Contractor shape (decimal hours, summaries) |
| Export Sage report as |
| Export Sage report as |
| Sync into SQLite: |
Server name registered with MCP: tsheets-sage-mcp (v1.0.0). Tools only — no MCP resources or prompts are registered.
Usage examples (Claude Desktop)
Search for all jobcodes matching "Acme" and show their IDs.Get a timesheet summary for last weekShow me detailed timesheets for jobcode 10001 from last weekGet last week's timesheets, format for Sage, and export as CSVGet last week's timesheets, format for Sage, and export as a PDFSync recent timesheet data into the local cacheGet project details for jobcode 10001Natural-language date ranges supported by the built-in parser include expressions such as last week, this week, last month, this month, today, yesterday, and week of MM/DD/YYYY (or YYYY-MM-DD). You can also pass explicit startDate / endDate as YYYY-MM-DD.
TSheets API notes used by this project are in docs/TSHEETS_API.md.
npm scripts
Script | What it does |
| Compile TypeScript to |
| Run compiled MCP server ( |
| Run |
| Interactive TSheets OAuth flow |
| Live API smoke test ( |
| Vitest unit tests (interactive / watch) |
| Vitest once (CI-style) |
| Vitest with coverage |
| CLI sync of last ~90 days into SQLite (requires prior |
| CLI full history sync from 2023-01-01 in ~90-day chunks (requires prior |
Project structure
Tsheets-MCP/
├── src/
│ ├── index.ts # MCP server entry (stdio, tool registration)
│ ├── api/ # TSheets HTTP client + API helpers
│ ├── auth/ # OAuth + token manager (refresh locking)
│ ├── db/ # SQLite schema, sync, queries
│ ├── tools/ # One module per MCP tool
│ ├── types/ # TSheets / Sage types
│ ├── utils/ # Date parsing and formatting
│ └── tests/ # Vitest tests + fixtures
├── scripts/
│ ├── auth-tsheets.ts # OAuth CLI
│ └── test-tsheets.ts # Live connectivity CLI
├── docs/
│ └── TSHEETS_API.md # API notes for this project
├── package.json
├── tsconfig.json
└── vitest.config.tsRuntime artifacts (gitignored): .env, .tokens.json, data/ / *.db, dist/.
Troubleshooting
"No tokens found" / services not initialized
Run npm run auth and ensure TOKEN_FILE_PATH points at the same token file Claude Desktop uses (include the leading dot if the file is .tokens.json).
"Failed to call tool"
Confirm all four required env vars are set in Claude Desktop config, paths are absolute, and Claude was restarted after edits.
"No timesheets found"
Check that time is being tracked in TSheets for that range; try npm run test:tsheets -- --dump. Prefer search_jobcodes then pass a numeric jobcodeId for exact matches.
TLS / certificate errors during auth or API calls
Use NODE_OPTIONS=--use-system-ca (already set in package scripts; add it to Claude Desktop env as shown above).
Empty or stale project history from get_project_details
Sync the cache first (sync_timesheets with recent/history, or npm run db:sync-recent / npm run db:sync-history after building). Full history sync starts at 2023-01-01 by design.
Port 3000 in use during npm run auth
The OAuth callback server defaults to port 3000 to match TSHEETS_REDIRECT_URI. Free the port or change both the redirect URI in TSheets and your env to match.
Known limitations / missing documentation
No committed
.env.example, Docker setup, or CI workflows in this repositoryNo Node.js version declared in
package.jsonenginesLicense metadata is inconsistent: root
LICENSEis MIT;package.jsoncurrently says ISCassets/may be empty and is not used by the appMCP host examples focus on Claude Desktop; other MCP clients are not documented here
History sync is hard-coded to begin at
2023-01-01
API references
License
See LICENSE in this repository (MIT License text as committed). Resolve the package.json "license" field if you need metadata to match.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Read and write Sage Intacct from Claude or ChatGPT. Write tools are flagged for approval.
Read your tracked time and projects, pause tracking or add a note, from Claude or ChatGPT.
Read and write NetSuite and run SuiteQL from Claude or ChatGPT. Write tools flagged for approval.
Connects AI assistants to TrackingTime for querying time entries, projects, tasks, customers, and team data using natural language.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides Claude with access to BigTime's time tracking and project management API, enabling retrieval of clients, projects, staff, time entries, and daily totals.17 npmMIT
- FlicenseAqualityDmaintenanceEnables Claude to interact with 7pace Timetracker for Jira, supporting time logging, worklog queries, and summaries.6-
- AlicenseAqualityDmaintenanceEnables Claude to interact with Toggl Track for time tracking, including starting/stopping timers, viewing current entries, and summarizing time by project via natural language.729 npmMIT
- -licenseNot gradedqualityCmaintenanceEnables Claude Desktop to add and edit ConstructionClock time entries directly through the ConstructionClock REST API.-