Timesheet Assistant MCP
Generates timesheets from activity data and automates submission to PSI Project Server (SharePoint-based systems) using browser automation. Works with Activity Collector MCP to fetch data from GitLab, GitHub, and Calendar services.
README
Timesheet Assistant MCP
An MCP (Model Context Protocol) server for generating timesheets and submitting them to PSI Project Server (SharePoint-based timesheet systems).
Features
- Timesheet Generation: Generate daily, weekly, monthly, or custom date range timesheets
- PSI Integration: Automated submission to PSI Project Server
- Activity Data Integration: Works with Activity Collector MCP for data fetching
- Smart Summarization: Automatically summarizes work descriptions to 255 characters
- Browser Automation: Uses Puppeteer for SharePoint authentication and form filling
- Task Management: Hierarchical task tree navigation for PSI
Prerequisites
⚠️ Important: This MCP requires Activity Collector MCP to fetch activity data from GitLab, GitHub, and Calendar services.
Installation
Via npx (Recommended)
npx timesheet-assistant-mcp
Via npm
npm install -g timesheet-assistant-mcp
From Source
git clone https://github.com/sharadmathuratthepsi/timesheet-mcp.git
cd timesheet-mcp
npm install
npm run build
Configuration
For Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"activity-collector": {
"command": "npx",
"args": ["activity-collector-mcp"]
},
"timesheet-assistant": {
"command": "npx",
"args": ["timesheet-assistant-mcp"]
}
}
}
For Claude Code (VS Code)
Add to ~/Library/Application Support/Code/User/mcp.json:
{
"servers": {
"activity-collector": {
"type": "stdio",
"command": "npx",
"args": ["activity-collector-mcp"]
},
"timesheet-assistant": {
"type": "stdio",
"command": "npx",
"args": ["timesheet-assistant-mcp"]
}
}
}
Configuration File
Create ~/.timesheet-assistant-mcp-config.json:
{
"psi": {
"url": "https://projectserver.thepsi.com/PWA/_layouts/15/pwa/Timesheet/MyTSSummary.aspx"
}
}
Usage
First Time Setup
- Configure PSI credentials:
Configure PSI with username: YOUR_USERNAME and password: YOUR_PASSWORD
Generating Timesheets
- Daily:
Generate timesheet for today - Weekly:
Generate timesheet for this week - Monthly:
Generate timesheet for November 2024 - Date Range:
Generate timesheet from 2024-12-01 to 2024-12-07
Submitting to PSI
- Generate timesheet (using Activity Collector MCP)
- Get PSI tasks (call once, reuse for all days):
Get PSI tasks for 2024-12-05 - Select task from the hierarchical tree
- Submit timesheet:
Submit to PSI for 2024-12-05 with task index 3 and description "..."
Available Tools (8)
Timesheet Generation (4 tools)
generate_timesheet- Generate monthly timesheetgenerate_weekly_timesheet- Generate weekly timesheetgenerate_daily_timesheet- Generate single day timesheetgenerate_date_range_timesheet- Generate custom date range timesheet
Note: These tools orchestrate the Activity Collector MCP to fetch data.
PSI Integration (4 tools)
configure_psi- Configure PSI credentialsget_psi_tasks- Get available tasks from PSI (call once per timesheet period)submit_to_psi- Submit timesheet entry to PSIinspect_psi_page- Debug PSI page structure
How It Works
Timesheet Generation Flow
- LLM calls timesheet generation tool (e.g.,
generate_weekly_timesheet) - Tool returns instructions for fetching data from Activity Collector MCP
- LLM uses Activity Collector tools (
fetch_gitlab_activity,fetch_github_activity,fetch_google_calendar_events) - LLM builds and formats the timesheet
PSI Submission Flow
- Call
get_psi_tasksonce to get available tasks - User selects a task by index
- Call
submit_to_psifor each day (reusing same task index) - Browser automation fills SharePoint form and saves
PSI Integration Details
- Uses Puppeteer for browser automation
- Supports HTTP Basic Auth for SharePoint
- Handles lazy-loaded accordion trees for task selection
- Smart grid cell detection for SharePoint JSGrid
- Automatic form filling with MouseEvent simulation
Security
- PSI credentials stored in
~/.timesheet-assistant-mcp-tokens.jsonwith restricted permissions (600) - Browser runs in non-headless mode by default (can see what's happening)
- All data remains local
Troubleshooting
Activity Collector Not Available
Error: fetch_gitlab_activity tool not found
Solution: Install and configure Activity Collector MCP
PSI Submission Fails
Error: Could not find hours cell
Solution: Run inspect_psi_page to check PSI page structure
Browser Crashes
Solution: Ensure Puppeteer dependencies are installed:
npm install puppeteer
License
MIT
Contributing
Issues and pull requests welcome!
Author
Sharad Mathur (sharad.mathur@thepsi.com)
Related Projects
- Activity Collector MCP - Required companion MCP for data fetching
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。