loading…
Search for a command to run...
loading…
A MCP server for OneDev for CI/CD pipeline editing, issue workflow automation, and pull request review
A MCP server for OneDev for CI/CD pipeline editing, issue workflow automation, and pull request review
TOD (TheOneDev) is a powerful command-line tool for OneDev 13+ that streamlines your development workflow by enabling you to run CI/CD jobs against local changes, set up local working directory to work on pull requests, etc. It also offers a comprehensive Model Context Protocol (MCP) server with tools and prompts, enabling you to interact with OneDev 13+ through AI assistants in an intelligent and natural way.
To install tod, just put tod binary into your PATH.
https://code.onedev.io/onedev/tod/~builds?query=%22Job%22+is+%22Release%22
Requirements:
Steps:
Clone the repository:
git clone https://code.onedev.io/onedev/tod.git
cd tod
Build the binary:
go build
TOD uses a configuration file to store commonly used settings, eliminating the need to specify them repeatedly.
Create a config file at: $HOME/.todconfig
The configuration uses INI format:
server-url=https://onedev.example.com
access-token=your-personal-access-token
mcp - Start MCP ServerStart the Model Context Protocol server for AI tool integration.
Syntax:
tod mcp [OPTIONS]
Options:
--log-file <file> - Specify log file path for debug loggingExample:
# Start MCP server
tod mcp
# Start with debug logging
tod mcp --log-file /tmp/tod-mcp.log
For detailed information about available MCP tools and their parameters, see MCP Documentation.
run-local - Run Jobs Against Local ChangesRun CI/CD jobs against your uncommitted local changes without the commit/push/run/check loop.
Syntax:
tod run-local [OPTIONS] <job-name>
Options:
--working-dir <dir> - Specify working directory (defaults to current directory). Working directory is expected to be inside
a git repository, with one of the remote pointing to a OneDev project--param <key=value> or -p <key=value> - Specify job parameters (can be used multiple times)Examples:
# Basic usage
tod run-local ci
# With parameters
tod run-local -p database=postgres -p environment=test ci
# Specify working directory
tod run-local --working-dir /path/to/project ci
How it works:
run - Run Jobs Against Branches or TagsRun CI/CD jobs against specific branches or tags in the repository.
Syntax:
tod run [OPTIONS] <job-name>
Options:
--working-dir <dir> - Specify working directory (defaults to current directory). Working directory is expected to be inside
a git repository, with one of the remote pointing to a OneDev project--branch <branch> - Run against specific branch (mutually exclusive with --tag)--tag <tag> - Run against specific tag (mutually exclusive with --branch)--param <key=value> or -p <key=value> - Specify job parameters (can be used multiple times)Examples:
# Run against main branch
tod run --branch main ci
# Run against a tag
tod run --tag v1.2.3 release
# Run with parameters
tod run --branch develop -p environment=staging ci
checkout - Checkout Pull RequestsCheckout pull requests locally for testing and review.
Syntax:
tod checkout [OPTIONS] <pull-request-reference>
Options:
--working-dir <dir> - Specify working directory (defaults to current directory). Working directory is expected to be inside
a git repository, with one of the remote pointing to a OneDev projectExample:
# Checkout pull request #123
tod checkout 123
# Checkout in specific directory
tod checkout --working-dir /path/to/project 456
check-build-spec - Check and Migrate Build SpecificationsCheck your .onedev-buildspec.yml file for validity and migrate it to the latest version if needed.
Syntax:
tod check-build-spec [OPTIONS]
Options:
--working-dir <dir> - Directory containing build spec file (defaults to current directory). Working directory is expected to be inside a git repository, with one of the remote pointing to a OneDev projectExample:
# Check build spec in current directory
tod check-build-spec
# Check build spec in specific directory
tod check-build-spec --working-dir /path/to/project
Set up configuration:
# Create ~/.todconfig
echo "server-url=https://onedev.example.com" > ~/.todconfig
echo "access-token=your-token-here" >> ~/.todconfig
Test local changes:
# Run CI against your uncommitted changes
cd /path/to/onedev-git-repository
tod run-local ci
Run against specific branch:
# Run ci job against the main branch
cd /path/to/onedev-git-repository
tod run --branch main ci
Checkout a pull request:
# Checkout pull request #123
cd /path/to/onedev-git-repository
tod checkout #123
# Multiple parameters of the same key
tod run-local -p env=test -p env=staging -p db=postgres ci
If OneDev is running behind Nginx, configure it to disable HTTP buffering for real-time log streaming:
location /~api/streaming {
proxy_pass http://localhost:6610/~api/streaming;
proxy_buffering off;
}
See OneDev Nginx setup documentation for details.
If the job accesses job secrets. Make sure the authorization field is cleared to allow all jobs. Set authorization to allow all branches is not sufficient as local change will be pushed to a temporal ref not belonging to any branch
TOD is part of the OneDev ecosystem. For contributions, issues, and feature requests, visit the OneDev project.
See license.txt for license information.
Add this to claude_desktop_config.json and restart Claude Desktop.
{
"mcpServers": {
"theonedev-tod": {
"command": "npx",
"args": []
}
}
}