mcp-devtools-server
Provides read-only Docker integration for listing containers, retrieving container logs, and inspecting container details, with secret masking and redaction.
Provides read-only access to allow-listed Git repositories, including viewing commit history, showing commits, diffs, blame, repository status, and listing repositories.
Provides read-only PostgreSQL access for running validated SELECT queries, explaining queries, and listing tables, with row limits, timeouts, and read-only transactions.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mcp-devtools-server
A Model Context Protocol server that lets AI clients read your git history, containers, Postgres, HTTP endpoints and logs, with every access going through allow-lists and an audit log.
MCP clients such as Claude Desktop, VS Code and Cursor are most useful when they can look at the systems you are debugging. The risk is that a tool which can "run git" or "query the database" ends up able to do anything. This server takes the opposite approach. Each tool is read-only and works on named aliases set by the operator, so it never sees raw paths or DSNs. Every argument is validated before a subprocess, socket or connection is opened, and every call is written to a JSON-lines audit trail with secrets redacted.
Features
Family | Tools | Guard rails |
Git |
| Repo allow-list. Revisions are validated so they can't be read as options. Paths are confined to the repo and passed after |
Docker |
| Container name/pattern allow-list. Only |
Postgres |
| DSN alias allow-list. A lexical SQL validator allows a single SELECT/WITH/VALUES/TABLE/SHOW/EXPLAIN and blocks DML, DDL and dangerous functions. Queries run in |
HTTP |
| Host and port allow-lists. SSRF guard blocks loopback, RFC 1918, CGNAT, link-local/metadata, multicast and IPv4-mapped forms. The peer address is re-checked after connecting. Every redirect hop is re-validated. Proxies from the environment are ignored. |
Logs |
| Directory allow-list with path-traversal and symlink-escape protection. Supports regex or substring search with context lines. Results are capped and the search has a time budget. Only the tail of huge files is scanned. Rotated |
Resources
devtools://config: the effective configuration, with DSNs reduced to alias names.devtools://audit/tail: the most recent audit entries.repo://{repo}/readmeandrepo://{repo}/files/{+path}: files of an allow-listed repo atHEAD.
Prompts
review_recent_commitsdiagnose_failing_containerexplain_slow_query
Each prompt is a short runbook that steers the model toward the right sequence of tool calls.
Operations
Per-family enable/disable switches.
YAML or TOML config with
${ENV}interpolation.stdio and streamable HTTP transports. HTTP supports an optional bearer token.
Multi-stage Docker image with a compose playground that includes a sample Postgres database.
Related MCP server: rustscp-mcp
Architecture
flowchart LR
subgraph Clients
CD[Claude Desktop]
VS[VS Code / Cursor]
HC[Any MCP client<br/>over HTTP]
end
CD -- stdio --> T
VS -- stdio --> T
HC -- streamable HTTP<br/>+ bearer token --> T
subgraph Server["mcp-devtools-server"]
T[MCPServer<br/>tools / resources / prompts]
T --> CTX[ToolContext.run]
CTX --> POL[Policy<br/>allow-lists, enable flags]
CTX --> AUD[(Audit log<br/>JSON lines, redacted)]
POL --> G1[Path confinement]
POL --> G2[SQL validator]
POL --> G3[SSRF guard]
CTX --> B{{Backend protocols}}
end
B --> GIT[SubprocessGitBackend] --> R[(git repos)]
B --> DCK[DockerCliBackend] --> D[(docker daemon)]
B --> PG[PsycopgBackend<br/>READ ONLY txn] --> P[(PostgreSQL)]
B --> HTTP[HttpxProber] --> W[(allow-listed hosts)]
B --> LOG[FileSystemLogSearcher] --> L[(log directories)]A tool call goes through these steps:
The MCP SDK validates the arguments against the generated JSON schema.
ToolContext.runopens an audit record.The policy resolves the alias and refuses anything that is not allow-listed.
The family-specific guard (paths, SQL or SSRF) runs.
The backend does the work behind a
Protocol.The result is returned as structured content.
Known failures surface to the client as error results with a stable code such as
[denied], [invalid], [disabled] or [backend_error].
Quickstart
git clone https://github.com/alexgeorghiou/mcp-devtools-server.git
cd mcp-devtools-server
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
cp examples/devtools.example.yaml devtools.local.yaml # edit the allow-lists
mcp-devtools check-config -c devtools.local.yaml # prints the effective, redacted config
mcp-devtools serve -c devtools.local.yaml # stdio (what desktop clients spawn)Useful extras:
mcp-devtools validate-sql "WITH x AS (DELETE FROM t RETURNING 1) SELECT * FROM x"
# rejected: keyword DELETE is not allowed in read-only queries
MCP_DEVTOOLS_HTTP_TOKEN=change-me mcp-devtools serve -c devtools.local.yaml -t http --port 8765
# streamable HTTP endpoint: http://127.0.0.1:8765/mcpDocker playground
docker compose up --buildThis starts the server on http://localhost:8765/mcp with bearer token change-me. It also
starts a sample lending library Postgres with a SELECT-only devtools_reader role and an
index that is deliberately missing, so explain_slow_query has something to find. The
repository itself is mounted as the devtools repo and examples/logs is mounted as the
sample log directory.
Client configuration
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"devtools": {
"command": "/path/to/mcp-devtools-server/.venv/bin/mcp-devtools",
"args": ["serve", "--config", "/path/to/devtools.local.yaml"],
"env": {
"DEVTOOLS_PG_PASSWORD": "reader-password",
"MCP_DEVTOOLS_DISABLE": "docker"
}
}
}
}On Windows, use C:\\path\\to\\mcp-devtools-server\\.venv\\Scripts\\mcp-devtools.exe.
VS Code (.vscode/mcp.json)
{
"servers": {
"devtools": {
"type": "stdio",
"command": "${workspaceFolder}/.venv/bin/mcp-devtools",
"args": ["serve", "--config", "${workspaceFolder}/devtools.local.yaml"]
}
}
}Cursor (~/.cursor/mcp.json or .cursor/mcp.json)
{
"mcpServers": {
"devtools": {
"command": "mcp-devtools",
"args": ["serve", "--config", "/path/to/devtools.local.yaml"]
}
}
}Streamable HTTP (shared or containerised server)
{
"servers": {
"devtools-http": {
"type": "http",
"url": "http://localhost:8765/mcp",
"headers": { "Authorization": "Bearer change-me" }
}
}
}From Python, using the SDK's client:
import httpx
from mcp.client import Client
from mcp.client.streamable_http import streamable_http_client
async with httpx.AsyncClient(headers={"Authorization": "Bearer change-me"}) as http:
async with Client(streamable_http_client("http://localhost:8765/mcp", http_client=http)) as c:
result = await c.call_tool("git_log", {"repo": "devtools", "max_count": 5})Configuration
See examples/devtools.example.yaml for every option. The key rules are:
Empty allow-list means nothing is allowed. This applies to repos, containers, databases, hosts and log directories.
Relative paths are resolved against the config file's directory.
${NAME}/${NAME:-default}pull values from the environment. A missing variable without a default fails at startup.
Environment variable | Purpose |
| Config file path (default for |
| Comma-separated families to switch off, e.g. |
| Override |
| Require |
Example audit line:
{"ts":"2026-03-01T10:02:16.412+00:00","tool":"pg_query","args":{"database":"library","sql":"SELECT ..."},"outcome":"ok","duration_ms":18.7,"error":null}Project structure
src/mcp_devtools/
├── cli.py # Typer CLI: serve (stdio|http), check-config, validate-sql
├── server.py # builds the MCPServer from enabled tool families
├── config.py # pydantic settings, YAML/TOML loading, env interpolation
├── audit.py # audit log + JSONL / in-memory sinks
├── http_auth.py # bearer-token ASGI middleware for streamable HTTP
├── resources.py # devtools://config, devtools://audit/tail, repo://...
├── prompts.py # review / diagnose / explain prompt templates
├── security/
│ ├── permissions.py # allow-list policy
│ ├── paths.py # path confinement
│ ├── sql_guard.py # PostgreSQL-aware lexer + read-only validator
│ ├── ssrf.py # URL, host, port and IP-range checks
│ └── redact.py # secret masking for logs and audit
├── backends/ # Protocol + real implementation per external system
│ ├── git.py docker.py postgres.py http.py logs.py
└── tools/ # MCP tool registration + service classes per family
├── context.py git_tools.py docker_tools.py db_tools.py http_tools.py log_tools.py
tests/ # fakes, temp git repo fixtures, in-memory MCP session tests
examples/ # example config, compose config, sample DB schema and logsTesting
ruff check . && ruff format --check . && mypy && pytestGit tests run against a real temporary repository created in a fixture.
Docker, Postgres and HTTP tests use in-memory fakes of the backend protocols. They also use scripted
subprocess.run/psycopg.connectdoubles andhttpx.MockTransport, so no daemon, database or network is needed.tests/test_server_session.pydrives the whole server through the SDK's in-memoryClient. It covers tool listing, structured results, error results, resources, resource templates, prompts and disabled families.tests/test_postgres_integration.pyruns against a real Postgres whenMCP_DEVTOOLS_TEST_PG_DSNis set. CI does this with a service container. These tests check that the database refuses writes even if the validator is bypassed, and that the statement timeout fires.
Design decisions and trade-offs
Aliases instead of raw paths, DSNs and URLs. The model never sees a connection string and cannot ask for a repo the operator didn't name. The cost is a little configuration up front.
Two layers for SQL. The lexical validator gives fast, readable rejections. It understands comments, dollar quoting and
E''strings, and catches side-effecting functions such aspg_terminate_backendanddblink, which a read-only transaction would still allow. The database'sREAD ONLYtransaction is the real guarantee. Neither replaces a SELECT-only role, which the compose setup and docs use.Row caps by fetching, not by rewriting SQL. Appending
LIMITbreaks on many valid queries. Instead the backend fetchesmax_rows + 1from a server-side cursor, so large results are never transferred and truncation is reported accurately.SSRF: resolve, check, connect, check again. The probe validates every resolved address before connecting. Afterwards it validates the socket's actual peer address, which narrows DNS-rebinding windows without needing a custom DNS-pinning transport. Proxies are disabled because they would hide the real peer.
CLI rather than SDKs for git and docker. Using the binaries means the server honours the operator's existing contexts, credentials and git config and adds no heavy dependency. The price is subprocess hardening, so arguments use argv lists, attached option values,
--separators and a safe-cconfig set.Errors are results, not crashes. Known failures carry a stable code so clients (and models) can tell "denied" from "broken". Connection failures in
http_probeare returned as data because "the site is down" is a valid answer.Sync backends in worker threads. The MCP SDK runs sync tools in a thread pool, which keeps backends simple and testable. An async rewrite would matter only for very high concurrency over HTTP.
Static bearer token for HTTP. It is enough for a local or sidecar deployment. Anything multi-user should sit behind the SDK's OAuth support or an authenticating proxy (see roadmap).
Roadmap
OAuth 2.1 resource-server mode for streamable HTTP via the SDK's
TokenVerifierPer-client policies (different allow-lists per token)
Kubernetes family (
kubectl get/describe/logs) behind the same backend protocolDocker Engine API backend over a read-only socket proxy
git_grepandgit_logpagination with cursorsOpenTelemetry spans alongside the audit log
Rate limiting per tool family
License
MIT © 2026 Alex Georghiou
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only production context for AI agents: Docker/K8s health, deploys, logs, traffic, code graph
1Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Governed access to sensitive data, secrets and APIs for AI agents. A signed proof for each decision.
Connect assistants to your company tools with per-person, per-action grants and a full audit log.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI clients to inspect backend systems through structured engineering tools including Git history, Winston logs, OpenAPI contracts, and sandboxed source code.2ISC
- AlicenseNot gradedqualityBmaintenanceEnables AI tools to securely inspect remote servers by listing directories, reading configuration files, and performing authorized actions through permission controls, human-in-the-loop approvals, and audit logging. It acts as a bastion that never reveals raw SSH credentials or root passwords to the model.2MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI-assisted DevOps by exposing scoped, role-based tools to inspect and remediate a Docker app stack, with audit logging and allow-listed commands for safe incident response.-
- FlicenseAqualityBmaintenanceEnables AI agents to safely interact with GitHub, query Postgres read-only, check deployment status, and search/read files within an allowlisted sandbox—all with dry-run writes and SQL/path safety gates.8-