npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tfs-mcp

v1.0.6

Published

TFS MCP 服务器是一个基于 Node.js 的工具,用于连接 TFS (Team Foundation Server) 系统,查询工作任务和代码权限。它实现了 MCP (Model Context Protocol) 协议,为客户端提供了一系列与 TFS 交互的功能。

Readme

TFS MCP 服务器

项目简介

TFS MCP 服务器是一个基于 Node.js 的工具,用于连接 TFS (Team Foundation Server) 系统,查询工作任务和代码权限。它实现了 MCP (Model Context Protocol) 协议,为客户端提供了一系列与 TFS 交互的功能。

环境要求

  • Node.js 12.0 或更高版本
  • npm 6.0 或更高版本
  • 网络连接到 TFS 服务器

安装

  1. 克隆或下载项目到本地
  2. 进入项目目录
  3. 安装依赖:
npm install

配置

方法一:环境变量配置(推荐)

设置以下环境变量:

  • TFS_URLS: JSON格式的TFS服务器地址列表,例如:["http://tfs-server-url:8080/tfs"]
  • TFS_PROJECTS: JSON格式的项目名称列表,例如:["项目1", "项目2"]
  • TFS_TOKEN: 个人访问令牌

方法二:配置文件

配置env环境变量

// TFS配置文件
const config = {
  // TFS服务器地址列表
  tfsUrls: ["http://tfs-server-url:8080/tfs"],

  // 个人访问令牌
  personalAccessToken: "your-personal-access-token",

  // 项目列表
  projects: ["项目1", "项目2"]
};

module.exports = config;

功能列表

| 工具名称 | 描述 | 参数 | |---------|------|------| | get_my_tasks | 查询分配给我的所有工作任务 | includeCompleted (boolean): 是否包含已完成的任务days (number): 查询最近N天的任务 | | get_task_details | 获取指定任务的详细信息 | taskId (string/array): 任务ID或任务ID数组 | | get_projects | 获取所有可用的TFS项目列表 | 无 | | get_code_repositories | 查询我有权限访问的代码库 | projectName (string): 项目名称(可选) | | get_user_info | 获取当前登录的TFS用户信息 | 无 | | get_user_tasks | 查询分配给指定用户的所有工作任务 | userName (string): 用户名称includeCompleted (boolean): 是否包含已完成的任务days (number): 查询最近N天的任务 |

使用方法

作为命令行工具

# 启动服务器
node tfs-mcp-server.js

# 或使用npm link后直接运行
tfs-mcp

作为模块使用

const TFSMCPServer = require('./tfs-mcp-server');

const server = new TFSMCPServer();
server.start();

协议说明

该服务实现了 MCP 协议,通过标准输入/输出进行通信。客户端可以发送 JSON-RPC 格式的请求,服务端会返回相应的结果。

示例请求

{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "get_my_tasks",
    "arguments": {
      "includeCompleted": false,
      "days": 7
    }
  },
  "id": 1
}

示例响应

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "找到 2 个任务 (修改日期: 2026-03-26 至今)"
      }
    ]
  }
}

使用示例

查询我的任务

# 启动服务器
node tfs-mcp-server.js

# 在另一个终端发送请求
echo '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"get_my_tasks","arguments":{"includeCompleted":false,"days":15}},"id":1}' | node tfs-mcp-server.js

查询任务详情

echo '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"get_task_details","arguments":{"taskId":"1912582"}},"id":2}' | node tfs-mcp-server.js

获取项目列表

echo '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"get_projects","arguments":{}},"id":3}' | node tfs-mcp-server.js

常见问题

1. 连接TFS服务器失败

  • 检查网络连接是否正常
  • 验证TFS服务器地址是否正确
  • 确认个人访问令牌是否有效
  • 检查环境变量是否正确设置

2. 无法查询到任务

  • 确认配置文件中的项目列表是否正确
  • 检查用户是否有相应的权限
  • 验证TFS服务器是否正常运行

3. 性能问题

  • 对于大型项目,查询可能会较慢,请耐心等待
  • 建议使用days参数限制查询时间范围
  • 避免一次查询过多任务

依赖

版本历史

  • v1.0.6: 初始版本

许可证

MIT