cbusillo/tabby-mcp-server
If you are the rightful owner of tabby-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The TabbyML MCP Server is a bridge that connects TabbyML to AI assistants, enabling efficient searching and understanding of any codebase.
TabbyML MCP Server
MCP server bridge that connects TabbyML to AI assistants for searching and understanding any codebase.
Prerequisites
- TabbyML running locally (default: http://localhost:8080)
- TabbyML authentication token
- Python 3.12+
- uv package manager
Setup
# Clone and install
git clone https://github.com/cbusillo/tabby-mcp-server.git
cd tabby-mcp-server
uv sync --all-groups
# Set up your TabbyML token (optional - can also pass via MCP config)
echo "TABBY_TOKEN=your_tabby_token_here" > .env
Quick Setup with Claude CLI
# Add the MCP server to Claude Code
claude mcp add-json tabby-mcp-server '{
"command": "uv",
"args": ["run", "--directory", "/path/to/tabby-mcp-server", "tabby-mcp-server"],
"env": {
"TABBY_TOKEN": "your_tabby_token_here",
"TABBY_URL": "http://localhost:8080"
}
}'
# If using absolute path to uv (recommended)
claude mcp add-json tabby-mcp-server '{
"command": "/opt/homebrew/bin/uv",
"args": ["run", "--directory", "/path/to/tabby-mcp-server", "tabby-mcp-server"],
"env": {
"TABBY_TOKEN": "your_tabby_token_here"
}
}'
Environment Variables
TABBY_TOKEN
- Required: Your TabbyML authentication tokenTABBY_URL
- Optional: TabbyML server URL (default:http://localhost:8080
)
Tools
list_repositories
- List all repositories indexed in TabbyMLsearch_code
- Search for code patterns in indexed repositorieschat_with_context
- Chat with TabbyML AI using repository contextsearch_documentation
- Search for information in documentation repositories
Development
uv run test # Run tests
uv run format # Format code
uv run lint # Lint code
uv run update-graphql # Update GraphQL client from TabbyML
Updating GraphQL Client
When TabbyML updates their GraphQL schema or you modify queries:
# Fetch latest schema and regenerate client code
uv run update-graphql
# This command will:
# 1. Fetch the latest schema from TabbyML
# 2. Convert it to GraphQL SDL format
# 3. Generate typed Python client code
# 4. Update src/tabby_mcp_server/graphql_client/
Note: Ensure TabbyML is running and TABBY_TOKEN
is set before updating.
Running Integration Tests
Integration tests require a running TabbyML instance:
# Skip integration tests (default)
uv run test
# Run all tests including integration tests
TABBY_TOKEN=your_token pytest tests/test_integration.py -v
# Run specific integration test
TABBY_TOKEN=your_token pytest tests/test_integration.py::TestTabbyIntegration::test_real_tabby_connection -v
Integration tests are marked with @pytest.mark.skipif
and will be skipped if:
- TabbyML is not running
TABBY_TOKEN
is not set- Connection to TabbyML fails
Optional: Git pre-commit hook
Create .git/hooks/pre-commit
:
#!/bin/bash
set -e
uv run format
uv run lint
uv run test
Then: chmod +x .git/hooks/pre-commit
Requirements
- TabbyML running locally (default: http://localhost:8080)
- Python 3.12+ (3.13 compatible)
- uv
Documentation Proxy
The tabby-mcp-server includes a built-in documentation proxy to solve TabbyML timeout issues with multi-language documentation sites. See for details.
# Start proxy for any documentation site
uv run tabby-doc-proxy --url https://docs.example.com/
# Configure TabbyML to use: http://localhost:8888/
Example CLAUDE.md for Your Project
Add this to your project's CLAUDE.md to leverage TabbyML for code understanding:
# CLAUDE.md
Project instructions for AI assistance.
## Available Tools
### TabbyML Integration
When working with this codebase, use the TabbyML MCP tools:
- `list_repositories` - View all indexed repositories
- `search_code` - Search for patterns, classes, methods in the codebase
- `chat_with_context` - Ask questions about the code with repository context
- `search_documentation` - Search in documentation repositories
## Code Search Strategy
1. **Before making changes**:
- Use `search_code` to find similar implementations
- Use `chat_with_context` to understand complex code sections
- Use `search_documentation` for API references and guides
2. **Understanding existing code**:
- List repositories to see what's available
- Search for usage patterns before implementing new features
- Ask contextual questions about specific repositories
## Example Workflow
When implementing a new feature:
1. First use `list_repositories` to see available codebases
2. Use `search_code` to find similar implementations
3. Use `chat_with_context` to understand the patterns
4. Check `search_documentation` for best practices
5. Implement following the discovered patterns