时间追踪与项目管理服务

BigTime MCP Server是一个模型上下文协议服务器,提供对BigTime时间追踪和项目管理API的访问,支持客户、项目、员工、时间记录和日常总计等信息的检索。

  • by amanat361
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 amanat361/bigtime-mcp-server

使用说明

BigTime MCP服务器

一个模型上下文协议(MCP)服务器,为Claude提供访问BigTime的时间跟踪和项目管理API的权限。此服务器使Claude能够从您的BigTime帐户中检索有关客户、项目、员工、时间条目和每日总计的信息。

特性

  • 客户管理:检索客户详细信息和列表
  • 项目访问:获取项目信息和详细信息
  • 员工信息:访问工作人员数据和详细信息
  • 时间跟踪:检索时间条目和每日总计
  • 任务管理:访问任务信息

安装

npm install bigtime-mcp-server

设置

  1. 获取您的BigTime API证书:

    • 您的BigTime帐户中的API代币
    • BigTime设置中的公司ID
  2. 创建一个 .env 项目根目录中的文件:

    BIGTIME_API_TOKEN=your_api_token_here
    BIGTIME_FIRM_ID=your_firm_id_here
    

快速开始

# Install dependencies
npm install

# Build the project
npm run build

项目结构

bigtime-mcp-server/
├── src/
│   ├── tools/        # MCP Tools
│   │   └── ExampleTool.ts
│   └── index.ts      # Server entry point
├── package.json
└── tsconfig.json

添加组件

该项目附带了一个示例工具 src/tools/ExampleTool.ts。您可以使用CLI添加更多工具:

# Add a new tool
mcp add tool my-tool

# Example tools you might create:
mcp add tool data-processor
mcp add tool api-client
mcp add tool file-handler

工具开发

工具结构示例:

import { MCPTool } from "mcp-framework";
import { z } from "zod";

interface MyToolInput {
  message: string;
}

class MyTool extends MCPTool<MyToolInput> {
  name = "my_tool";
  description = "Describes what your tool does";

  schema = {
    message: {
      type: z.string(),
      description: "Description of this input parameter",
    },
  };

  async execute(input: MyToolInput) {
    // Your tool logic here
    return `Processed: ${input.message}`;
  }
}

export default MyTool;

发布到npm

  1. 更新你的package.json:

    • 确保 name 是唯一的,遵循npm命名约定
    • 设置适当 version
    • 添加 description, author, license等等。
    • 检查 bin 指向正确的条目文件
  2. 在本地构建和测试:

    npm run build
    npm link
    bigtime-mcp-server  # Test your CLI locally
    
  3. 登录npm(必要时创建帐户):

    npm login
    
  4. 发布您的包:

    npm publish
    

发布后,用户可以将其添加到他们的claude桌面客户端(见下文)或使用npx运行它


## Using with Claude Desktop

### Local Development

Add this configuration to your Claude Desktop config file:

**MacOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows**: `%APPDATA%/Claude/claude_desktop_config.json`

```json
{
  "mcpServers": {
    "bigtime-mcp-server": {
      "command": "node",
      "args":["/absolute/path/to/bigtime-mcp-server/dist/index.js"]
    }
  }
}

发布后

将此配置添加到您的Claude Desktop配置文件中:

MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json 视窗: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "bigtime-mcp-server": {
      "command": "npx",
      "args": ["bigtime-mcp-server"],
      "env": {
        "BIGTIME_API_TOKEN": "your_api_token_here",
        "BIGTIME_FIRM_ID": "your_firm_id_here"
      }
    }
  }
}

建造和测试

  1. 对工具进行更改
  2. 跑 npm run build 编写
  3. 服务器将在启动时自动加载您的工具

了解更多