debtool-mcp
Enables an agent to discover and inspect Debian packages by intent, including searching commands/apps/services, showing compact package cards, extracting man-page excerpts, looking up package providers, comparing candidates, and producing simulated install plans using local dpkg/apt metadata.
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., "@debtool-mcp what can extract text from a PDF?"
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.
debtool-mcp
A local, read-only MCP server that lets an LLM agent discover and use Debian packages by intent, not by guessing command names. It answers questions like:
"What can extract text from a PDF?" →
pdftotext, already installed"How do I trim a video?" → a ranked list of installed and available tools
"Which package provides
cowsay?" →cowsay, plus the install command"Show me the two options I need and one example." → a compact card, not a 3,000-line man page
The design goal is low token cost: results are short Markdown cards, sorted by usefulness, with an explicit next step on every answer.
What it is not
debtool never runs sudo, never installs anything, never starts apps or
services, and never executes the tools it describes. deb_install_plan only
simulates an install and prints the exact command for the user to run. The
only file it writes is its own SQLite index under ~/.cache/debtool/.
Related MCP server: Linux System MCP Server
Install
Requirements: Debian/Ubuntu, Python ≥ 3.10, dpkg, apt, man-db.
# from this directory
uv tool install .
# or
pipx install .Then build the index once:
debtool refresh # ~10 s on a typical desktop
debtool statusdebtool refresh --scope installed builds a much smaller, faster index that
contains only installed packages (available-package search is then disabled).
MCP client configuration
The entry point is debtool-mcp and speaks MCP over stdio.
Generic JSON (Claude Desktop, most clients):
{
"mcpServers": {
"debtool": {
"command": "debtool-mcp",
"args": []
}
}
}OpenCode (opencode.json):
{
"mcp": {
"debtool": {
"type": "local",
"command": ["debtool-mcp"],
"enabled": true
}
}
}If debtool-mcp is not on the client's PATH, use an absolute path or run it
through uv:
{
"mcpServers": {
"debtool": {
"command": "uv",
"args": ["run", "--directory", "/home/yann/dev/MCP_Debian_tools", "debtool-mcp"]
}
}
}For HTTP/SSE instead of stdio:
debtool serve --transport streamable-http --host 127.0.0.1 --port 8000Tools
Tool | Purpose | Typical call |
| Find by intent across commands, apps, packages, services |
|
| One compact card: package, binaries, options, examples |
|
| Focused man-page excerpt |
|
| Package that provides a command, file or virtual package |
|
| Simulated install + exact |
|
| Compare 2–6 candidates |
|
| Index freshness, counts, optional helpers |
|
| Rebuild the index when stale |
|
deb_man modes are synopsis (default), examples, options, files, and
full. Start with the first two; full is large by design.
Resources: deb://status, deb://installed.
Prompt: find_debian_tool(task) — a guided search → card → examples →
install-plan workflow.
Example interaction
user: I need to pull the text out of some PDFs.
agent -> deb_search("extract text from pdf")
pdftotext (cmd, installed) poppler-utils — PDF to text converter (version 3.03)
pdfimages (cmd, installed) poppler-utils — PDF image extractor
hint: deb_card("pdftotext") for usage; deb_man("pdftotext", mode="examples")
agent -> deb_card("pdftotext")
## command: pdftotext
package: poppler-utils (installed 25.03.0-5+deb13u4)
Portable Document Format (PDF) to text converter (version 3.03)
use: pdftotext [options] PDF-file [text-file]
opts: -f number … first page, -l number … last page, -r number … resolution
docs: man pdftotextThe agent now has enough to run pdftotext -f 1 -l 5 in.pdf out.txt without
reading the full manual.
How the index is built
At refresh time, debtool reads local, already-trusted metadata:
/var/lib/dpkg/status— installed packagesapt-cache dumpavail— available packages (88 MB of stanzas, deduped by host architecture)/var/lib/dpkg/info/*.list— installed files, binaries and man pageswhatis/ man-db — one-line descriptions for commands/usr/share/applications— desktop entries/usr/lib/systemd/system,/usr/share/dbus-1— services
These are merged into one SQLite database with an FTS5 index. One query hits packages, commands, desktop apps and services at once.
Search also expands a small built-in intent table (pdf, ocr, video,
compress, disk, http, backup, …) so "trim video" also considers
ffmpeg, mpv and friends even when those words never appear in a package
description.
Token-efficiency choices
Progressive disclosure: search → card → man excerpt → full page.
Hard caps: 8 hits by default, 20 options, 12,000 characters per response (
DEBTOOL_MAX_OUTPUT).One-line summaries are clipped on word boundaries.
Install plans show the command, a simulation summary, and nothing else.
Every result ends with a concrete next call.
Configuration
Variable | Default | Meaning |
|
| Cache directory |
|
| Index path |
|
| Rebuild when dpkg/apt metadata changes |
|
| Max index age in seconds (0 = no age limit) |
|
| Max characters returned per tool call |
Optional helpers
Installed file lists cover reverse lookup for installed packages. To also map not-installed commands to packages, install the standard helpers:
sudo apt install command-not-found apt-file
sudo apt update && sudo apt-file updatedebtool detects and uses them automatically; no configuration needed.
apt-file and command-not-found are only useful once their data is present:
deb_status reports "installed but its Contents index is empty" (or database)
and names the command that fixes it, and deb_provides skips the call until
then instead of waiting on an empty cache.
appstreamcli, tldr and bwrap are used opportunistically when present.
Limitations
Man pages are indexed only for installed packages;
deb_manon an uninstalled package reaches man-db at call time and may find nothing.Available-package reverse lookup by command needs
apt-fileorcommand-not-found.The apt candidate is approximated by arch preference, not by full APT pinning policy;
deb_install_planalways checks the real candidate withapt-cache policybefore printing anything.Multiarch duplicates are collapsed to one record per package name.
Development
uv venv
uv pip install -e ".[dev]"
pytest
ruff check src tests
debtool refresh
debtool search "disk usage"Tests use an in-memory SQLite fixture and do not touch the real index.
License
The Unlicense: this is free and unencumbered software released into the public domain. See LICENSE.
Available Tools
8 toolsdeb_cardCRead-onlyIdempotent
Compact usage card for one command, package, app or service.
Inputs: target (required), kind. Returns: result
deb_compareCRead-onlyIdempotent
Compare candidates: installed state, size, binary count, summary.
Inputs: targets (required). Returns: result
deb_install_planARead-onlyIdempotent
Simulate an install and print the exact sudo command for the user.
Inputs: package (required), recommends. Returns: result
deb_manCRead-onlyIdempotent
Focused excerpt from a man page instead of the whole page.
Inputs: name (required), mode, query, section, +1 more. Returns: result
deb_providesBRead-onlyIdempotent
Which package provides a command or file (installed or available).
Inputs: target (required). Returns: result
deb_refreshAIdempotent
Rebuild the local index. Only call when deb_status reports it is stale.
Inputs: scope. Returns: result
deb_searchBRead-onlyIdempotent
Find Debian commands, applications or packages for an intent.
Inputs: query (required), kind, limit, installed. Returns: result
deb_statusBRead-onlyIdempotent
Index freshness, size and counts; optional helper availability.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct operation: search, provides, man, card, install_plan, compare, status, and refresh. There is little overlap, and the descriptions make the boundaries clear.
All tools consistently use the deb_ prefix, which makes the server easy to identify. The suffixes mix noun and verb forms (deb_card, deb_search, deb_status, deb_refresh), but the pattern remains predictable and readable.
Eight tools is well-scoped for a Debian package/command lookup and planning server. Each tool has a distinct role, and there is no obvious bloat.
The surface covers discovery, package ownership, man pages, comparisons, install planning, and index maintenance. Minor gaps exist, such as no uninstall/removal plan or dependency inspection, but core workflows are supported.
Related MCP Connectors
Package intelligence MCP for AI agents — 22 tools, 19 ecosystems, AGPL SDK, free.
Load saved packs of agent skills and MCP servers with one command; search 1,000+ AI agent tools.
Package intelligence for AI agents across npm, PyPI, crates.io and deps.dev. No API keys.
Package intelligence for AI agents across npm, PyPI, crates.io and deps.dev. No API keys.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to install, remove, update, and query apt packages on Linux via MCP tools.106MIT
- AlicenseAqualityCmaintenanceEnables AI agents to interact with the Linux desktop through desktop notifications, interactive dialogs, shell command execution, and privileged command execution.15MIT
- AlicenseAqualityNot gradedmaintenanceEnables AI agents to search and inspect installed tools and packages across many package managers through a read-only indexed catalog, with optional real-time web research enrichment.4MIT
- AlicenseBqualityCmaintenanceEnables LLMs and AI assistants to access Dart/Flutter package information from pub.dev. Provides tools for searching packages and retrieving metadata, versions, scores, changelogs, READMEs, and dependency trees over stdio or HTTP.109 npm1MIT