Skip to main content
Glama
mi6gin

repo-inspector-mcp

by mi6gin

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 .env and private-key filenames;

  • ignored generated directories such as .git, .venv, vendor, and node_modules;

  • deterministic unit tests for the security boundaries.

Related MCP server: Local Code MCP Server

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]"
pytest

Run the server over MCP stdio:

MCP_REPO_ROOT=/absolute/path/to/target/repository repo-inspector-mcp

The 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

Available Tools

3 tools
list_filesB

List readable source files below a repository path.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathNo.
max_depthNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

There are no annotations, so the description carries the full burden. It conveys a read-only listing action and a 'readable' filter, but it does not disclose recursion behavior, whether directories are included, symlink handling, or permission-related limits. For a simple listing tool this is a minimal but not rich disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one concise front-loaded sentence. It states the action, resource, and scope immediately, with no filler. For a simple listing tool this is well-structured and appropriately sized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present, the return shape is covered. However, the description lacks details about max_depth semantics, hidden/file types, and usage relative to siblings. Given the low complexity of the tool, this is adequate but leaves some context gaps an agent would need to disambiguate during invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It implies 'path' refers to a repository path, but it does not explain max_depth or add meaning beyond the schema defaults. The description adds almost no parameter semantics beyond what the agent can infer from the parameter names and defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action: listing readable source files below a repository path. The verb 'list' plus the resource 'source files below a repository path' clearly differentiates it from sibling tools read_file (content reading) and search_in_repo (searching).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives no guidance on when to use list_files rather than read_file or search_in_repo. It neither names alternatives nor states conditions for exclusion. The only context is the sibling tool names, which require the agent to infer relationships.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

read_fileA

Read a UTF-8 text file within the configured repository root.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathYes
max_charsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the disclosure burden. It usefully discloses the UTF-8 encoding requirement and the repository-root confinement, which set agent expectations about path handling. It does not disclose behavior on missing files, non-UTF-8 content, or how max_chars truncation affects the returned content, though the output schema partially covers return values.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single 12-word sentence that leads with the verb, states the resource, and closes with the scope constraint. Every word earns its place with zero redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-file tool with an output schema, the description is mostly adequate, covering target resource and path scope. However, with 0% schema parameter coverage and no annotations, the missing explanation of max_chars and edge-case behavior leaves noticeable gaps an agent must resolve elsewhere.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, but it only does so for path via the 'repository root' scoping hint. The max_chars parameter receives no explanation beyond its title and default, leaving the agent to guess at truncation semantics and units.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb (Read), a precise resource (UTF-8 text file), and a scope constraint (within the configured repository root). This clearly distinguishes it from siblings list_files and search_in_repo, which cover enumeration and content search respectively.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage context is implied: an agent reads a file when it needs its contents, rather than listing files or searching for matches. However, there is no explicit guidance about when to prefer this over search_in_repo, which could also surface file content, and no mention of prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_in_repoB

Search text files and return file, line, and matching text.

ParametersJSON Schema
NameRequiredDescriptionDefault
pathNo.
queryYes
max_resultsNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the behavioral disclosure burden. It does convey that the tool searches text files and returns file/line/matching-text results, and the word 'text' implies non-text files are ignored. However, it does not explain match semantics, case sensitivity, regex support, max_results behavior, or path interpretation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single front-loaded sentence with no filler words. It communicates the core operation and return format economically, earning its place without unnecessary detail.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The presence of an output schema reduces the need to document return values, and this is a simple search tool with obvious read semantics. However, with no annotations, no parameter descriptions, and no usage guidance, the definition is only minimally viable and leaves several practical details for the agent to infer.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for the three parameters. It only loosely implies that 'query' is the search text; 'path' and 'max_results' receive no explanatory context. This is a partial but insufficient compensation for the schema's lack of descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Search') and a clear resource ('text files'), and it defines the return shape as 'file, line, and matching text.' This clearly differentiates it from siblings list_files and read_file, though it does not explicitly name those alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus list_files or read_file, and no exclusions are mentioned. The only implied context is that search is useful for finding text matches across files, but the description does not make this explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 3 tool updatesv0.1.0
    • First observedlist_files
    • First observedread_file
    • First observedsearch_in_repo

TDQS

A3.8/5.0
Disambiguation5/5

Each tool targets a distinct action: listing files, reading a single file, and searching content. There is no overlap between these operations.

Naming Consistency5/5

All tool names follow a consistent verb_noun snake_case pattern: list_files, read_file, search_in_repo. The naming style is uniform and predictable.

Tool Count5/5

Three tools is an appropriate size for a repository inspection server. Each tool covers a core need without unnecessary bloat.

Completeness5/5

The server covers the essential inspection workflow: discover files, read their contents, and search across them. For its stated purpose, there are no significant missing operations.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

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