Model Context Protocol (MCP) server providing integrated tools for Microsoft Team Foundation Server (TFS) operations. Features include:
Project description
Microsoft TFS MCP Server
A Model Context Protocol (MCP) server that provides secure access to Microsoft Visual Studio Team Foundation Server (TFS) repositories through authenticated PAT connections.
Features
- List all available TFS projects
- List all repositories in a TFS project using authenticated PAT connections
- Get detailed commit history with author filtering
- Built-in proxy support for enterprise environments
- Comprehensive error handling and logging
- Secure HTTPS communication with TFS REST API
Installation
pip install mistfs-mcp-server
Requirements
- Python 3.9 or higher
mcppackage version 1.2.0 or higher- Access to Microsoft Visual Studio Team Foundation Server
- Valid TFS Personal Access Token (PAT) with appropriate permissions
- Environment variable
TFS_PATmust be set with your TFS Personal Access Token - Network access (with proxy support if needed)
Environment Setup
- Set your TFS Personal Access Token:
set TFS_PAT=your_pat_token_here
- (Optional) Configure proxy settings if required:
set HTTP_PROXY=http://your.proxy.server:port
set HTTPS_PROXY=http://your.proxy.server:port
- Verify your setup by starting the server and checking the logs in
mistfs_mcp_server.log
Usage
Starting the Server
# Run as a command
mistfs-mcp-server
# Or import in your Python code
from mistfs_tools.server import mcp
mcp.run()
Using with MCP Clients
This package implements the Model Context Protocol (MCP), allowing AI assistants and other MCP-compatible clients to interact with Team Foundation Server.
Example of how an MCP client might use this tool:
from mcp.client import Client
client = Client()
# Get all available TFS projects
projects = await client.Get_Projects()
print(projects) # List of all project names in TFS
# Get repositories in a project
repos = await client.Get_Project_Repositories(project_name="MyProject")
print(repos) # List of repository names in MyProject
# Get commit history for a specific user
commits = await client.Get_Repository_Checkins(
project_name="MyProject",
repository_name="MyRepo",
userupn="user@company.com"
)
print(commits) # List of commits by the specified user with detailed information
API Reference
Get_Projects
Retrieves all available projects from Microsoft Visual Studio Team Foundation Server.
Features:
- Authenticates using Personal Access Token (PAT)
- Makes HTTPS requests to TFS API
- Supports enterprise proxy configurations
- Includes detailed error handling and logging
Returns:
- List of project names in the TFS server, or an error message if the operation fails
Get_Project_Repositories
Retrieves repositories from a specified Microsoft Visual Studio Team Foundation Server project.
Parameters:
project_name(string, required): Name of the Microsoft Visual Studio Team Foundation Server project
Features:
- Authenticates using Personal Access Token (PAT)
- Makes HTTPS requests to TFS API
- Supports enterprise proxy configurations
- Includes detailed error handling and logging
Returns:
- List of repository names in the specified project, or an error message if the operation fails
Get_Repository_Checkins
Retrieves commit history from a specified repository in Microsoft Visual Studio Team Foundation Server.
Parameters:
project_name(string, required): Name of the project in Microsoft Visual Studio Team Foundation Serverrepository_name(string, required): Name of the repository to checkuserupn(string, required): User UPN to filter commits by author
Features:
- Filters commits by specific user
- Returns detailed commit information including:
- Commit ID
- Author name
- Commit date
- Commit message
- Requires TFS_PAT environment variable for authentication
- Supports secure HTTPS connections
- Includes proxy support for enterprise environments
- Comprehensive error handling and logging
Returns:
- List of commit details or appropriate error message
Available Tools
| Tool | Description |
|---|---|
| Get_Projects | Retrieve all available projects from Microsoft Visual Studio Team Foundation Server using PAT authentication |
| Get_Project_Repositories | Retrieve repositories from a specific TFS project using PAT authentication |
| Get_Repository_Checkins | Retrieve detailed commit history from TFS repositories with user filtering |
Development
Project Structure
mistfs-mcp-server/
├── src/
│ └── mistfs_tools/
│ ├── __init__.py
│ ├── __main__.py
│ └── server.py # Core implementation of MCP tools
├── LICENSE
├── README.md
└── pyproject.toml
The `server.py` contains the following key components:
- FastMCP server initialization
- Proxy configuration for enterprise environments
- Comprehensive logging setup
- Implementation of three main tools:
- Get_Projects
- Get_Project_Repositories
- Get_Repository_Checkins
Error Handling
All tools implement comprehensive error handling for:
- Missing PAT authentication
- Network connectivity issues
- Invalid project or repository names
- API response errors
- Proxy-related issues
Errors are both logged to file (mistfs_mcp_server.log) and returned as meaningful error messages to the client.
Proxy Support
The server includes built-in proxy support for enterprise environments. Proxy settings can be configured through environment variables or the built-in proxy configuration in the code.
Building and Publishing
python -m build
python -m twine upload dist/*
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
- Swapnil Dagade (swapnildagade@gmail.com)
Links
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mistfs_mcp_server-0.0.5.tar.gz.
File metadata
- Download URL: mistfs_mcp_server-0.0.5.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71749c5c65a2650055a11e904e13536aae148ddaf735dbb25c2ce790988fffac
|
|
| MD5 |
adec2fba97ef603f3273fab64df89c68
|
|
| BLAKE2b-256 |
9d92bbb533fda0e62716f4b414d8ffc807038f59a648a2719d490bcc789cc1da
|
File details
Details for the file mistfs_mcp_server-0.0.5-py3-none-any.whl.
File metadata
- Download URL: mistfs_mcp_server-0.0.5-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
880333a298fd8f385208269ac198d68a323ac1356ae12b85044e81109baeb265
|
|
| MD5 |
96fabeb1180b3274d63e97dd54d2bbea
|
|
| BLAKE2b-256 |
bea6f063436b75fffd589ada51f1d764edbcb17729b289b128f5733908812021
|