tfs-mcp-server
This server connects Claude to an on-premise TFS (Team Foundation Server) via REST API, enabling reading and writing of work items, backlogs, sprints, and pull requests. Supports TFS 2017/2018 and Azure DevOps Server via API version configuration.
Run custom WIQL queries (
tfs_query_wiql): Execute Work Item Query Language queries to filter and retrieve work item IDs based on custom conditions.Fetch work item details (
tfs_get_work_items): Retrieve detailed information (title, state, assignee, story points, etc.) for one or more work items by ID.Get sprint/backlog contents (
tfs_get_backlog): List work items (User Stories, Tasks, Bugs) within a specific iteration/sprint for a team.List iterations/sprints (
tfs_get_iterations): Retrieve all iterations/sprints for a team, including names, paths, and start/end dates.List Pull Requests (
tfs_list_pull_requests): Retrieve PRs from a Git repository, filterable by status (active, completed, abandoned, or all).Get Pull Request details (
tfs_get_pull_request): Fetch detailed info about a specific PR, including description, creator, reviewers, and status.Get PR file changes (
tfs_get_pr_changes): List files added, modified, or deleted in the latest iteration of a Pull Request.Create work items (
tfs_create_work_item): Create User Stories, Tasks, Bugs, Test Cases, etc., with full field support including area path, iteration, tags, and custom fields.Add comments to work items (
tfs_add_work_item_comment): Append a comment to the History field of a work item (write operation; requires explicit user confirmation).
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@tfs-mcp-serverShow work items in the current sprint"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
tfs-mcp-server
MCP server kết nối trực tiếp với TFS (Team Foundation Server) on-premise qua REST API, cho phép Claude đọc/ghi work item, backlog, sprint, và Pull Request mà không cần copy/paste thủ công.
Lưu ý về phiên bản: bạn nhắc "TFS 2027" — hiện tại chưa có phiên bản TFS nào tên như vậy (dòng TFS dừng ở 2018, sau đó đổi tên thành Azure DevOps Server 2019/2020/2022). Có thể ý bạn là TFS 2017 hoặc TFS 2018. Server này được viết để dùng với REST API chuẩn của TFS 2017/2018 (và tương thích ngược với Azure DevOps Server các bản sau nếu chỉnh
TFS_API_VERSION). Nếu bạn cho biết đúng phiên bản, mình chỉnh lạiapi-versionmặc định cho khớp.
Yêu cầu
Node.js 18 trở lên, chạy trên máy có thể truy cập mạng nội bộ tới server TFS
TFS đã bật Personal Access Token (PAT) — có từ TFS 2017 Update 1 trở lên. Vào TFS: góc trên phải → Security → Personal access tokens → tạo token mới với quyền:
Work Items: Read & write
Code: Read
Project and Team: Read
Nếu TFS của bạn chỉ hỗ trợ NTLM/Windows Authentication (chưa bật được PAT), báo lại — code hiện tại cần chỉnh lại phần xác thực trong src/tfsClient.ts bằng thư viện hỗ trợ NTLM (ví dụ axios-ntlm) thay vì Basic Auth với PAT.
Related MCP server: spike-mcp
Cài đặt
npm install
npm run buildCấu hình
Copy .env.example thành .env và điền thông tin:
cp .env.example .envTFS_BASE_URL=http://tfs.congty.local:8080/tfs
TFS_COLLECTION=DefaultCollection
TFS_DEFAULT_PROJECT=YourProject
TFS_PAT=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TFS_API_VERSION=4.1Nếu không chắc TFS_API_VERSION, cứ thử 4.1 trước — nếu tool báo lỗi HTTP 400/404 khi gọi, hạ xuống 3.2 rồi 2.3 (đây là các phiên bản REST API tương ứng TFS 2017).
Đăng ký với Claude
Claude Code
Thêm vào file .mcp.json ở thư mục project (hoặc ~/.claude.json cho toàn cục):
{
"mcpServers": {
"tfs": {
"command": "node",
"args": ["/duong-dan-tuyet-doi-toi/tfs-mcp-server/dist/index.js"],
"env": {
"TFS_BASE_URL": "http://tfs.congty.local:8080/tfs",
"TFS_COLLECTION": "DefaultCollection",
"TFS_DEFAULT_PROJECT": "YourProject",
"TFS_PAT": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"TFS_API_VERSION": "4.1"
}
}
}
}Claude Desktop
Mở claude_desktop_config.json (Settings → Developer → Edit Config), thêm mục tương tự vào mcpServers.
Sau khi thêm, khởi động lại Claude Code/Desktop — các tool tfs_* sẽ xuất hiện trong danh sách tool khả dụng.
Danh sách tool
Tool | Chức năng |
| Chạy truy vấn WIQL tùy chỉnh |
| Lấy chi tiết work item theo ID |
| Lấy danh sách work item trong một sprint/iteration |
| Lấy danh sách sprint theo cấp project, trả |
| Liệt kê Pull Request theo trạng thái |
| Chi tiết một Pull Request |
| Danh sách file thay đổi trong PR |
| Tạo work item mới: User Story, Task, Bug, Test Case... |
| Thêm comment vào work item (thao tác ghi dữ liệu) |
Các tool này khớp trực tiếp với input mà các skill trong bộ em-toolkit (sprint-retro, sprint-planning-summary, pr-review-checklist, bug-triage) cần — khi cả hai được cài cùng lúc, Claude có thể tự lấy dữ liệu từ TFS thay vì bạn phải copy/paste.
Tạo work item
Tool tfs_create_work_item dùng REST API JSON Patch của TFS/Azure DevOps. Ví dụ tạo User Story:
{
"workItemType": "User Story",
"title": "[SAMPLE] Báo cáo tổng kết vòng lặp có đủ metric",
"description": "User story mẫu để kiểm tra báo cáo velocity, bug ratio và chất lượng kiểm thử.",
"areaPath": "EngineeringManagerToolkit",
"iterationPath": "EngineeringManagerToolkit\\Alpha",
"assignedTo": "user@example.com",
"tags": ["em-toolkit-sample", "reporting"],
"fields": {
"Microsoft.VSTS.Scheduling.StoryPoints": 8,
"Microsoft.VSTS.Common.Priority": 1
}
}Ví dụ tạo Bug:
{
"workItemType": "Bug",
"title": "[SAMPLE] Báo cáo thiếu phân tích nguyên nhân bug",
"iterationPath": "EngineeringManagerToolkit\\Alpha",
"tags": ["em-toolkit-sample", "bug-ratio"],
"fields": {
"Microsoft.VSTS.Common.Severity": "2 - High",
"Microsoft.VSTS.Common.Priority": 1
}
}Có thể truyền validateOnly: true để kiểm tra request nếu phiên bản TFS hỗ trợ, và truyền thêm field tùy biến qua object fields theo reference name.
Bảo mật
Không commit file
.env— đã có PAT thật trong đó. Thêm.envvào.gitignore.PAT nên đặt hạn dùng ngắn (30-90 ngày) và chỉ cấp đúng quyền cần thiết.
Server này chạy local trên máy bạn (qua stdio), không có thành phần nào gửi dữ liệu ra ngoài ngoại trừ chính TFS server bạn cấu hình.
Gỡ lỗi thường gặp
401 Unauthorized: kiểm tra PAT còn hạn không, có đúng quyền không, và TFS đã bật tính năng PAT chưa.
404 Not Found: kiểm tra
TFS_COLLECTION, tên project, tên repository có đúng chính xác (phân biệt hoa/thường và khoảng trắng) không.400 Bad Request ở các tool liên quan work item: thường do
TFS_API_VERSIONkhông khớp phiên bản server — thử các giá trị 2.3 / 3.0 / 3.2 / 4.1.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/rickey-cpu/tfs-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server