FreeAgent MCP服务器
用于管理FreeAgent时间表和计时器的Claude MCP(模型上下文协议)服务器。此服务器允许Claude与您的FreeAgent帐户交互,以跟踪时间、管理计时器和处理时间间隔操作。

特性
- 使用嵌套数据列出和过滤时间戳
- 创建新的时间表
- 更新现有时间表
- 启动和停止计时器
- 删除时间夹
- 自动刷新OAuth令牌
- 全面的错误处理
- Docker支持
先决条件
- Node.js 18+(用于直接使用Node.js)
- Docker和Docker Compose(用于容器化使用)
- 具有API访问权限的FreeAgent帐户
- 来自的OAuth凭据 FreeAgent开发人员仪表板
安装
选项1:直接安装Node.js
- 克隆存储库:
git clone https://github.com/yourusername/freeagent-mcp.git
cd freeagent-mcp- 安装依赖项:
npm install- 获取您的OAuth令牌:
# 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选项2:Docker安装
- 克隆存储库:
git clone https://github.com/yourusername/freeagent-mcp.git
cd freeagent-mcp- 创建环境文件:
cp .env.example .env
# Edit .env with your FreeAgent credentials- 构建Docker镜像:
docker build -t freeagent-mcp .配置
将服务器添加到MCP设置中(通常在 %APPDATA%/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json):
对于Node.js安装:
{
"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": []
}
}
}对于Docker安装:
{
"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": []
}
}
}用法
配置后,Claude可以使用以下工具:
列出时间表
{
"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
}创建时间表
{
"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"
}定时器控制
// Start timer
{
"id": "123"
}
// Stop timer
{
"id": "123"
}发展
Node.js开发
# Build the project
npm run build
# Watch for changes
npm run watch
# Run tests (when implemented)
npm testDocker开发
# Build the Docker image
docker build -t freeagent-mcp .贡献
- 分叉存储库
- 创建功能分支(
git checkout -b feature/amazing-feature) - 提交您的更改(
git commit -am 'Add some amazing feature') - 推到分支(
git push origin feature/amazing-feature) - 打开拉取请求
许可证
此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。
致谢
- FreeAgent出色的API文档
- MCP SDK的Claude团队
