repo-inspector-mcp
Repository Inspector MCP
A small read-only MCP server for inspecting a local source repository from an AI client. The project is designed as a portfolio and learning example. It exposes a narrow set of tools instead of giving the model unrestricted shell access.
Features
list_files: list source files below the configured root;read_file: read UTF-8 text files with a size limit;search_in_repo: search text files and return matching lines;path traversal protection and symlink rejection;
sensitive-file filtering for
.envand private-key filenames;ignored generated directories such as
.git,.venv,vendor, andnode_modules;deterministic unit tests for the security boundaries.
Requirements
Python 3.10 or newer;
an MCP-compatible client such as Codex.
Local setup
python3.12 -m venv .venv
. .venv/bin/activate
python -m pip install -e ".[dev]"
pytestRun the server over MCP stdio:
MCP_REPO_ROOT=/absolute/path/to/target/repository repo-inspector-mcpThe server is intentionally read-only. It does not execute shell commands, write files,
or expose files outside MCP_REPO_ROOT.
Codex configuration
Use the example in docs/codex-config.toml. Replace the executable path and the repository
root with absolute paths. After restarting the client, the following tools are available:
list_files(path, max_depth);read_file(path, max_chars);search_in_repo(query, path, max_results).
Design notes
The MCP layer in server.py is intentionally thin. Path validation, file-size limits,
binary-file detection, and search behavior live in the dependency-free core.py, which
makes the security-sensitive behavior easy to test without starting an MCP client.
License
MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mi6gin/repo-inspector-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server