tfs-mcp-server
Click on "Deploy 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-server Show my active work items from the Triage saved query."
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 (stdio) for Microsoft TFS / Azure DevOps Server using REST API 6.0.
Gives an AI agent tools for work items, Git repository files (read and write: branches, commits, pull requests) and identity lookup.
Work items and repositories may live in different team projects: every tool accepts an
optional project argument that overrides the configured default.
Requirements
Node.js 20+
A TFS / Azure DevOps Server collection reachable over HTTPS
A Personal Access Token with scopes: Work Items (read & write), Code (read & write; write is needed for the Git write tools - branches, commits and pull requests), Identity (read)
Related MCP server: WorkItems DevOps MCP Server
Install & build
npm install
npm run build # -> dist/index.js
npm test # vitest (all TFS calls are mocked)Configuration (environment variables)
Variable | Required | Description |
| yes | Collection URL, e.g. |
| yes | Personal access token (sent as Basic auth) |
| no | Project used when a call omits |
| no | Default |
| no | Parallelism for fan-out batch tools (default |
| no |
|
See .env.example.
Cursor (~/.cursor/mcp.json or .cursor/mcp.json)
{
"mcpServers": {
"tfs": {
"command": "node",
"args": ["/absolute/path/to/tfs-mcp-server/dist/index.js"],
"env": {
"TFS_BASE_URL": "https://tfs.corp.local/tfs/DefaultCollection",
"TFS_PAT": "<your PAT>",
"TFS_DEFAULT_PROJECT": "MyProject"
}
}
}
}Claude Desktop uses the same shape in claude_desktop_config.json.
Interactive testing
TFS_BASE_URL=... TFS_PAT=... npm run inspect # opens the MCP Inspector against dist/index.jsTools
All tools return a short text summary plus a JSON payload (structuredContent).
Errors are returned as tool errors with the TFS message, HTTP status and request URL.
Work items
Tool | Purpose |
| Metadata, rich-text content (Description / Repro Steps / Acceptance Criteria, HTML converted to text by default), relations, optional comments |
| Same for many ids in one call ( |
| Paged comments (ids needed for updates) |
| JSON-Patch update. |
| Same update applied to many ids via |
| Add a comment (plain text is wrapped into HTML) |
| Same comment on many work items (bounded-concurrency fan-out) |
| Replace the text of an existing comment |
| Saved query by GUID or path: WIQL, columns, type; folders list children |
| Execute a saved query; optional |
| Execute an arbitrary WIQL string as-is |
assignedTo accepts a display name, DOMAIN\user, an e-mail, Display Name <DOMAIN\user>, or "" to unassign.
Use get_current_identity / search_identities to obtain valid values.
Files (Git)
Tool | Purpose |
| Repositories of a project (or the whole collection) |
| File content at |
| Several files from one repo/version in one call ( |
| Entries under a directory (one level or recursive) with object ids, content type and latest commit |
Git write (branches, commits, pull requests)
Tool | Purpose |
| Create |
| One commit on an existing |
| Open |
| One-shot workflow: create |
Identity
Tool | Purpose |
| Who the PAT belongs to ( |
| Find users/groups by name, account or e-mail |
Example flows
get_current_identity -> assignedToValue = "Jane Doe <CORP\\jdoe>"
run_query { queryId: "Shared Queries/Team/Triage", extraWhere: "[System.Tags] CONTAINS 'hotfix'" }
update_work_items { ids: [...], state: "Active", assignedTo: "Jane Doe <CORP\\jdoe>" }
add_comment_to_work_items { ids: [...], text: "Picked up in sprint 12" }
get_files_content { project: "Infra", repository: "tools", branch: "develop", paths: ["/README.md", "/src/main.ts"] }
create_branch_commit_and_pull_request {
project: "Infra", repository: "tools", newBranch: "feature/1234-bump-timeout", targetBranch: "develop",
message: "Bump request timeout to 60s",
changes: [{ path: "/src/config.ts", changeType: "edit", edits: [{ find: "timeoutMs: 30_000", replace: "timeoutMs: 60_000" }] }],
workItemIds: [1234]
}Notes on TFS API versions
Work item, WIQL, Git and repository endpoints use
api-version=6.0.The work item comments API only exists as a preview in 6.0; the server uses
6.0-preview.3.connectionData(6.0-preview) andidentities(6.0-preview.1) are collection-scoped; the identities call is optional and failures are tolerated.wit/$batchis used for bulk updates; if a server rejects it (404/405/400) the tool transparently falls back to individual PATCH requests.Branches are created with
POST git/repositories/{repo}/refs(old object id000…0), commits withPOST .../pushes(one commit,rawtextorbase64encodedcontent), pull requests withPOST .../pullrequests. Work items are linked viaworkItemRefson creation; ids thatGET .../pullRequests/{id}/workitemsdoes not report afterwards are linked with anArtifactLinkrelation tovstfs:///Git/PullRequestId/{projectId}%2F{repositoryId}%2F{pullRequestId}.If TFS answers with an HTML sign-in page or HTTP 203 instead of JSON, the PAT is invalid or the base URL does not point at a collection; the error message says so.
Project layout
src/
index.ts stdio entrypoint
server.ts McpServer factory + tool registration
config.ts env parsing, project resolution
client.ts REST client (Basic PAT auth, URL builder, TfsApiError)
services/ TFS API wrappers (workitems, git (read), gitwrite (branches/pushes/PRs), identity)
tools/ MCP tool definitions (zod schemas)
util/ html->text, batch helpers, tool result helpers
tests/ vitest suites with a mocked fetchAvailable Tools
17 toolsadd_comment_to_work_itemsAdd the same comment to multiple work itemsA
Add one comment text to many work items. The comments API has no batch endpoint, so requests are fanned out with bounded concurrency; per-item results (comment ids / errors) are reported.
Inputs: ids (required), text (required), project.
add_work_item_commentAdd work item commentA
Add a discussion comment to a work item. Plain text is converted to HTML; HTML is accepted as-is. Returns the new comment id.
Inputs: id (required), text (required), project.
get_current_identityGet current identityARead-onlyIdempotent
Identify the user behind the configured PAT: id, display name, account (DOMAIN\user or e-mail), descriptor, plus a ready-to-use assignedToValue for update_work_item(s). Also returns basic server info (deployment type, instance id).
Inputs: no named parameters.
get_file_contentGet file contentARead-onlyIdempotent
Read a file from a Git repository at a given branch/commit/tag (default: the repo's default branch). Text files are returned inline; binaries as base64. If the file does not exist, the error explains whether the repository, the branch or the directory is missing and lists the parent directory's entries.
Inputs: path (required), repository (required), tag, branch, +3 more.
get_files_contentGet multiple files' contentARead-onlyIdempotent
Read several files from one repository at the same branch/commit/tag in a single call. Existence and metadata are checked with one itemsbatch request, then contents are fetched in parallel. Missing files are reported per path with the same verbose diagnostics as get_file_content.
Inputs: paths (required), repository (required), tag, branch, +3 more.
get_queryGet saved queryARead-onlyIdempotent
Read a saved work item query by GUID or path (e.g. 'Shared Queries/Team/Open Bugs'): name, path, type, columns and WIQL text. For folders, children are listed (depth 1).
Inputs: queryId (required), project.
get_work_itemGet work itemARead-onlyIdempotent
Get a single work item: metadata (type, title, state, assignee, area/iteration, tags, dates), rich-text content (description, repro steps, acceptance criteria), relations (parent/children/links) and optionally its comments.
Inputs: id (required), expand, fields, format, +2 more.
get_work_item_commentsGet work item commentsARead-onlyIdempotent
List discussion comments of a work item (paged). Returns comment ids needed for update_work_item_comment.
Inputs: id (required), top, order, format, +3 more.
get_work_itemsGet multiple work itemsARead-onlyIdempotent
Read many work items in one call (uses the workitemsbatch API, chunked by 200 ids). Missing ids are reported in failed instead of failing the whole request (errorPolicy=omit).
Inputs: ids (required), expand, fields, format, +3 more.
list_directoryList directoryARead-onlyIdempotent
List files and folders under a directory path in a Git repository (one level or full recursion) with metadata: object ids, content type, and the latest commit that touched each entry.
Inputs: repository (required), tag, path, branch, +4 more.
list_repositoriesList Git repositoriesARead-onlyIdempotent
List Git repositories in a project (or in the whole collection when no project is given), with default branch and URLs.
Inputs: project.
run_queryRun saved queryARead-onlyIdempotent
Execute a saved query by GUID or path and return the matching work items. Optionally append a custom WIQL filter (extraWhere, passed as-is and AND-ed with the query's WHERE clause), e.g. "[System.State] = 'Active' AND [System.Tags] CONTAINS 'hotfix'".
Inputs: queryId (required), top, fields, format, +2 more.
run_wiqlRun WIQLARead-onlyIdempotent
Execute an arbitrary WIQL query string as-is, e.g. "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @project AND [System.State] = 'Active'". Returns the matching work items (flat) or the link tree (tree/oneHop queries).
Inputs: wiql (required), top, fields, format, +1 more.
search_identitiesSearch identitiesARead-onlyIdempotent
Find users or groups by display name, account name or e-mail to obtain a valid assignedTo value. Returns id, display name, unique account name and assignedToValue for each match.
Inputs: query (required), filter, includeGroups.
update_work_itemUpdate work itemAIdempotent
Update a work item's metadata via JSON Patch. state and assignedTo are mandatory; other fields are optional. Returns the updated work item.
Inputs: id (required), state (required), assignedTo (required), tags, +13 more.
update_work_item_commentUpdate work item commentAIdempotent
Replace the text of an existing comment (use get_work_item_comments to find comment ids).
Inputs: id (required), text (required), commentId (required), project.
update_work_itemsUpdate multiple work itemsAIdempotent
Apply the same update (state + assignedTo, optionally more fields/comment) to many work items. Uses the wit/$batch endpoint (one HTTP request per 200 items) and falls back to parallel single PATCH calls if $batch is unavailable. Per-item results are reported.
Inputs: ids (required), state (required), assignedTo (required), tags, +12 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Most tools target clearly distinct resources and actions, such as fetching a single work item vs. many, or reading file content vs. listing a directory. The main area of potential confusion is between the singular/plural comment tools, especially add_work_item_comment and add_comment_to_work_items, though their descriptions clarify the difference.
Tool names mostly follow a consistent snake_case verb_noun pattern: list_, get_, update_, add_, run_, and search_. Minor deviations exist, notably add_comment_to_work_items vs. add_work_item_comment and get_current_identity, but overall the naming is predictable and readable.
17 tools is slightly above the ideal range but reasonable for a server covering both work item management and Git repository file access. Each tool serves a distinct purpose, and the count reflects the breadth of the domain without feeling bloated.
The work item surface is strong for reading and updating, including bulk operations and comments, but there is no create_work_item or delete_work_item, which is a notable lifecycle gap. The Git side is also read-only, covering file/directory access but no branch, commit, or repository management operations.
Maintenance
Related MCP Connectors
Provides capabilities that let LLM agents perform a range of infrastructure management tasks.
Read and write KukGit repositories, files, issues and pull requests from an AI assistant.
Query your team's drift, vulnerability, and upgrade data from any AI assistant. OAuth 2.1, 51 tools.
Discover, inspect and run 63,000+ agent tools from one balance. Pay per call, no subscriptions.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to query and interact with Azure DevOps data, including work items, projects, ticket statistics, and backlog information through natural language commands.-
- FlicenseNot gradedqualityFmaintenanceEnables LLMs and AI applications to interact with Azure DevOps Work Items, supporting queries, filtering, status updates, date management, effort tracking, descriptions, and comments through natural language.-
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to interact with Azure DevOps APIs for managing projects, work items, repositories, pull requests, and pipelines through natural language.1MIT
- AlicenseCqualityDmaintenanceEnables AI agents to interact with Azure DevOps through natural language, supporting work items, pull requests, sprints, boards, teams, repositories, and wiki pages.30MIT