Skip to main content
Glama
mcp-toolkit

mcp-toolkit

by isumitjha

mcp-toolkit

CI License: MIT

Coding agents often guess about the machine they work on: which process holds port 3000, whether the node on PATH is the one the project expects, which keys a .env is missing. mcp-toolkit lets them ask instead. It is an MCP server; MCP (Model Context Protocol) is an open protocol through which AI applications call tools that separate programs provide. Every tool is read-only, and the agent gets answers without getting a shell.

Install

Requires Python 3.13+ on macOS or Linux, and lsof for the port tool (preinstalled on macOS; apt install lsof on Debian/Ubuntu).

Most MCP clients start servers from a JSON configuration like this one. Where the file lives, and whether the key is mcpServers, depends on the client:

{
  "mcpServers": {
    "mcp-toolkit": {
      "command": "uvx",
      "args": [
        "--from", "git+https://github.com/isumitjha/mcp-toolkit@v0.1.0",
        "mcp-toolkit", "--root", "/path/to/your/project"
      ]
    }
  }
}

Clients that take a command line instead can use:

uvx --from git+https://github.com/isumitjha/mcp-toolkit@v0.1.0 mcp-toolkit --root .

@v0.1.0 pins a release, so the code the client runs changes only when you change the tag; without it, every start would run whatever is on main. . is the directory the client starts the server in, which differs between clients, so an absolute path is clearer. --root can be given more than once. Without it, the file tool refuses every path (see Security). To install once instead of through uvx, run uv tool install git+https://github.com/isumitjha/mcp-toolkit@v0.1.0 and use "command": "mcp-toolkit".

Related MCP server: AI Knowledge Center MCP

Tools

The server speaks MCP over stdio. Each tool returns structured content, described by an output schema, and the same data as JSON text.

check_tools

Where git, python3, pip3, node, npm, uv and docker resolve on PATH, the first line of each one's --version, copies further down PATH that the first one hides, and problems with PATH itself: duplicate, missing, empty or relative entries.

{
  "tools": [
    {"name": "python3", "path": "/opt/homebrew/bin/python3", "version": "Python 3.13.5", "shadowed": ["/usr/bin/python3"]},
    {"name": "node", "path": "/Users/me/.nvm/versions/node/v22.16.0/bin/node", "version": "v22.16.0", "shadowed": []},
    {"name": "docker", "path": null, "version": null, "shadowed": []}
  ],
  "path_problems": ["PATH lists /opt/homebrew/bin more than once"]
}

This is the server's own PATH, which the client sets when it starts the server. Desktop apps often get a shorter PATH than a login shell, a common reason for a tool to be missing here but present in a terminal.

find_port_listeners

Processes listening on a TCP port (1-65535), or on every TCP port when it is omitted.

{
  "listeners": [
    {"command": "node", "pid": 4410, "user": "me", "protocol": "TCP", "address": "*:3000"}
  ]
}

The operating system shows other users' processes only to root, so an empty list means that nothing visible to the server's user is listening.

compare_env_keys

Compares the key names in a reference file (usually .env.example) with those in a target file (usually .env).

{
  "missing": ["STRIPE_WEBHOOK_SECRET"],
  "extra": ["LEGACY_API_TOKEN"],
  "shared": 14,
  "problems": [{"file": "target", "line": 9, "problem": "duplicate key DATABASE_URL"}],
  "problem_count": 1
}

Values are never returned. Both paths must be inside a --root; a relative path starts at the first root. Only dotenv files are read: the file name, after symlinks are resolved, must be .env, .env.* (such as .env.example) or *.env, and a file in which most lines are not KEY=value is refused. It understands export KEY=value, comments, and quoted values that span several lines, and it refuses files that are larger than 1 MiB or not UTF-8. problems lists the first 20 of each file and problem_count gives the total.

A value that spans lines must be quoted. Without quotes, base64 data such as a PEM key can end in a line that looks like NAME= (the = is padding). Such a line is reported as a problem instead of a key when it comes right after a long line of base64, or when the name is in mixed case with no underscore and no value, so an empty key written that way, such as apiKey=, is reported too.

Security

The agent decides which tools to call and with which arguments, and it may be acting on text it read somewhere untrusted. So the server treats every argument as hostile and returns only what each tool describes.

  • Read-only. No tool runs a shell, writes a file, stops or signals a process, or opens a network connection.

  • Fixed programs. The server runs two kinds of program: <tool> --version for the seven tools above, and lsof -nP -iTCP[:port] -sTCP:LISTEN -FpcLPn. Both are taken only from absolute PATH directories, never from . or another relative entry, and run with an argument list instead of a shell command line, a timeout (5 and 15 seconds), stdin connected to /dev/null and a PATH without relative entries. At most 8 KiB of --version output and 1 MiB of lsof output is read; a program that prints more is stopped and counts as failed. Output is decoded with invalid bytes replaced. The port is checked to be an integer from 1 to 65535 before lsof runs, and -n and -P keep lsof from making DNS lookups.

  • Files only under --root. A path is resolved first, including .. and every symlink, and refused unless the result is inside one of the roots. That stops ../, absolute paths and symlinks that point elsewhere. The resolved path is then opened from the root one directory at a time without following symlinks, so a directory or file swapped for a symlink after the check makes the read fail instead of leaving the root. Only regular files are read: FIFOs and devices, which could block or have side effects, are refused before they are opened, and at most 1 MiB is read. Error messages repeat the path the agent gave, not where a symlink led.

  • --root is about files only. It limits which files the file tool reads, nothing else: check_tools reports where tools are installed and which PATH entries have problems, wherever they are on the machine.

  • No root by default. Without --root, the file tool refuses every path. The working directory would be a convenient default, but clients start servers in different places, often the home directory or /, so that default could quietly mean everything. Roots come only from the command line, not from the client's MCP roots, so whoever configures the server sets the boundary.

  • No secrets. Dotenv values are skipped while parsing and are never stored, returned or logged; problems are reported by line number. Only files named like dotenv files are read, and files that are mostly not KEY=value are refused: lines of other files, such as private keys, can look like NAME= and would return part of a secret as a key name. Process command lines, which often contain tokens, are never read.

  • Clean text. Control and format characters in anything that came from the system (paths, versions, process names, lsof errors) are replaced with U+FFFD, so the output cannot carry terminal escape sequences or hidden bidirectional text.

Limits: the root check is about paths, not about what a file is. A hard link inside a root is a file in the root, and a directory moved out of a root while a read walks through it is still read. So do not use a root that other users can write to: where the system allows hard links to files the linking user cannot read, another user could link one of the server user's files into the root for the agent to read. And the server cannot stop an agent from reading files through other tools its client gives it.

Development

uv sync
uv run ruff check . && uv run ruff format --check . && uv run ty check
uv run pytest

Tests call every tool through the MCP SDK's in-memory client, and one test runs the installed mcp-toolkit command over stdio. A stand-in lsof records the arguments it was given, so the tests run anywhere. To try the server by hand, the MCP Inspector can start it: npx @modelcontextprotocol/inspector uv run mcp-toolkit --root .

See CONTRIBUTING.md and CHANGELOG.md.

Roadmap

  • check_binary_architecture: the CPU architectures in a Mach-O or ELF binary, such as an x86_64-only tool on Apple Silicon

  • --tool NAME to check more tools than the default seven

  • The working directory of each listening process, to tell which project a dev server belongs to

License

MIT

Available Tools

3 tools
check_toolsA
Read-only

Report which git, python3, pip3, node, npm, uv and docker this machine would run.

For each tool: the path its name resolves to on PATH, the first line of its --version output, and other copies further down PATH that the first one hides. Also lists PATH problems: duplicate, missing, empty or relative entries. This is the PATH of the server process, which the MCP client set when it started the server; a login shell may see a different one. Runs only <tool> --version, for tools in absolute PATH directories.

Inputs: no named parameters. Returns: tools, path_problems

compare_env_keysA
Read-only

Compare the key names of two dotenv files, such as .env.example and .env.

Returns the keys the target is missing, the keys only the target has, how many keys both have, and problems in either file (duplicate keys, lines that are not KEY=value, unclosed quotes) by line number, the first 20 of each file. Values are never returned. Both files must be named .env, .env.* or *.env and be inside a directory the server was started with (--root); a relative path starts at the first of them.

Inputs: target (required), reference (required). Returns: extra, shared, missing, problems, +1 more

find_port_listenersA
Read-only

List the processes listening on a local TCP port, or on every TCP port.

Use it to find what holds a port, for example after an "address already in use" error. Each listener has the command name, PID, user, protocol and listening address. The operating system shows other users' processes only to root, so an empty list means that no process visible to this user is listening. Nothing is stopped or signalled.

Inputs: port. Returns: listeners

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool targets a completely separate resource: toolchain/PATH resolution (check_tools), TCP port ownership (find_port_listeners), and dotenv key comparison (compare_env_keys). There is no plausible scenario where an agent would confuse one for another, and the descriptions reinforce the distinct scopes.

    Naming Consistency5/5

    All three names follow the same snake_case verb_noun convention: check_tools, find_port_listeners, compare_env_keys. The verbs are accurate and differentiated (check/find/compare), giving a predictable pattern.

    Tool Count4/5

    Three tools is on the lean side for something called a 'toolkit', but each one is a self-contained, non-trivial diagnostic with a clear purpose. Nothing feels like filler, though a broader toolkit label invites more coverage.

    Completeness3/5

    The set covers three useful local-diagnostics cases but has visible gaps: no general process listing, no environment-variable inspection of the server process itself (only file-to-file key comparison), and no disk/network/environment checks. Each individual tool is self-contained with no dead ends, but the overall diagnostic surface is only partially covered.

    Maintenance

    ActivityNo data
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Zero-config MCP server that gives AI coding assistants a real-time diagnostic snapshot of your local dev environment. Detects framework, running services, recent errors, git state, and provides a health diagnosis in one call.
      3
      80 npm
      2
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      A secure, local-first MCP server for read-only inspection and troubleshooting of development environments, exposing narrow, typed, auditable capabilities for repository inspection, log summarization, Docker review, and security scanning without granting unrestricted machine access.
      8
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Read-only MCP server to inspect allowlisted Docker containers, systemd services, JSONL logs, and HTTP health endpoints without arbitrary shell access.
      MIT