GitHub Actions for installing and running ToolHive, a tool for managing Model Context Protocol (MCP) servers.
- name: Install ToolHive
uses: StacklokLabs/toolhive-actions/install@v0
with:
version: latest # or specify a version like 'v0.2.5'
- name: Run Fetch MCP Server
uses: stackloklabs/toolhive-actions/run-mcp-server@v0
with:
server: fetch
Installs the ToolHive CLI (thv
) on your GitHub Actions runner.
Features:
- π Auto-detects OS and architecture
- π Supports specific version installation
- β Checksum verification for security
- π Caching for faster subsequent runs
- π₯οΈ Cross-platform support (Linux, macOS, Windows)
Runs MCP servers using the installed ToolHive CLI.
Features:
- π¦ Run servers from ToolHive registry
- π³ Support for Docker images
- π§ Protocol schemes (uvx://, npx://, go://)
- π Secret management
- π Volume mounting
- π Network isolation
- π οΈ Tool filtering
Persists MCP server configurations to a file and optionally uploads as an artifact.
Features:
- πΎ Save MCP server configurations
- π€ Upload as GitHub Actions artifact
- π·οΈ Filter servers by labels
- π JSON format output
name: Use ToolHive
on: [push]
jobs:
example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install ToolHive
uses: StacklokLabs/toolhive-actions/install@v0
- name: Run Fetch Server
uses: StacklokLabs/toolhive-actions/run-mcp-server@v0
with:
server: fetch
- name: Use the MCP Server
run: |
# Your code that uses the MCP server
echo "Server is running at ${{ steps.run-server.outputs.url }}"
- name: Run GitHub MCP Server
uses: stackloklabs/toolhive-actions/run-mcp-server@v0
with:
server: github
secrets: |
{
"GITHUB_PERSONAL_ACCESS_TOKEN": "${{ secrets.GITHUB_TOKEN }}"
}
- name: Run Custom MCP Server
uses: StacklokLabs/toolhive-actions/run-mcp-server@v0
with:
server: my-org/my-mcp-server:latest
transport: sse
proxy-port: 8080
- name: Run Python MCP Server
uses: stackloklabs/toolhive-actions/run-mcp-server@v0
with:
server: uvx://my-python-mcp-server@latest
volumes: |
./data:/app/data
- AI-Powered CI/CD: Integrate MCP servers into your workflows for AI-assisted tasks
- Documentation Generation: Use MCP servers to generate or update documentation
- Code Analysis: Run MCP servers for advanced code analysis and suggestions
- Testing: Use MCP servers in your test suites for AI-powered testing
- Automation: Automate complex tasks with MCP server capabilities
- GitHub Actions runner (ubuntu-latest, macos-latest, or windows-latest)
- Docker or Podman (for running MCP servers on Linux)
- GitHub token (automatically provided in Actions)
Runner OS | Architecture | Install | Run Server | Notes |
---|---|---|---|---|
Ubuntu | amd64 | β | β | Fully supported |
Ubuntu | arm64 | β | β | Fully supported |
macOS | amd64 | β | See #3 | |
macOS | arm64 | β | See #3 | |
Windows | amd64 | β | See #2 | |
Windows | arm64 | β | See #2 |
Windows: PowerShell PATH Issue (#2)
The thv
command may not be recognized in PowerShell after installation. Workarounds:
- Use
shell: bash
in your workflow steps - Reference the full path:
${{ steps.install.outputs.path }}
macOS: Container Runtime Not Available (#3)
ToolHive cannot run MCP servers on macOS runners due to missing container runtime. Workarounds:
- Use Linux runners for running MCP servers
- Use macOS only for installation testing
For the latest status and updates on these issues, please check the issues page.
- All downloads are verified using checksums
- Runs with minimal required permissions
- Secrets are handled securely
- Network isolation available for enhanced security
We use semantic versioning and maintain major version tags:
@v0
- Latest v0.x.x release (recommended for stability)@v0.0.2
- Specific version@main
- Latest development version (not recommended for production)
We welcome contributions! Please see our Contributing Guide for details.
# Clone the repository
git clone https://github.com/StacklokLabs/toolhive-actions.git
cd toolhive-actions
# Test the actions locally using act (https://github.com/nektos/act)
act -W .github/workflows/test.yml
# Or push to a branch and let GitHub Actions run the tests
git checkout -b test-branch
git push origin test-branch
To test these actions in your own repository:
name: Test ToolHive Actions
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install ToolHive
uses: StacklokLabs/toolhive-actions/install@v0
- name: Verify installation
run: thv version
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- ToolHive - The main ToolHive project
- ToolHive Documentation - Official documentation
- MCP Specification - Model Context Protocol specification
- GitHub Issues - Bug reports and feature requests
- Discord - Community support and discussions
- Documentation - Official ToolHive documentation