Metadata-Version: 2.4
Name: project-analysis-mcp
Version: 0.1.0
Summary: MCP server providing project analysis tools: statistics, code search, module listing, and dependency analysis.
Project-URL: Homepage, https://github.com/hejiahui/python-claude-code-wt
Project-URL: Repository, https://github.com/hejiahui/python-claude-code-wt
Author: hejiahui
License: MIT
Keywords: code-analysis,llm-tools,mcp,model-context-protocol
Requires-Python: >=3.11
Requires-Dist: mcp>=1.0.0
Requires-Dist: pydantic>=2.5.0
Description-Content-Type: text/markdown

# project-analysis-mcp

An [MCP](https://modelcontextprotocol.io) server that helps an LLM understand
and analyze a codebase. It exposes four read-only tools:

| Tool | Description |
|------|-------------|
| `project_stats` | File/line statistics grouped by file extension |
| `find_code` | Search source files for a text/regex pattern (with context) |
| `list_modules` | List Python modules with their docstrings and class/function structure |
| `analyze_dependency` | Analyze how a dependency is imported/used across a project |

Transport: **stdio** (JSON-RPC). Python ≥ 3.11.

## Install & run

### Option A — from PyPI (recommended)

```bash
uvx project-analysis-mcp
# or
pipx install project-analysis-mcp
```

### Option B — from this repo (editable)

```bash
cd mcp-servers/project_analysis_mcp_pkg
uv pip install -e .
# then run:
project-analysis-mcp
```

### Option C — run the module directly (no install)

```bash
uv run --directory <repo-root> python mcp-servers/project_analysis_mcp.py
```

## Configure a client

Add the server to your client's MCP config (the exact file depends on the
client: `mcp.json`, `settings.json`, `claude_desktop_config.json`, etc.).

**Using the console script (after install):**

```json
{
  "mcpServers": {
    "Project Analysis": {
      "command": "project-analysis-mcp"
    }
  }
}
```

**Using `uvx` (auto-fetches the package):**

```json
{
  "mcpServers": {
    "Project Analysis": {
      "command": "uvx",
      "args": ["project-analysis-mcp"]
    }
  }
}
```

**Using the repo directly (no publish):**

```json
{
  "mcpServers": {
    "Project Analysis": {
      "command": "uv",
      "args": [
        "run", "--directory", "/abs/path/to/repo",
        "python", "/abs/path/to/repo/mcp-servers/project_analysis_mcp.py"
      ],
      "env": {}
    }
  }
}
```

## Notes

- All tools are read-only and operate on a `project_path` you pass in.
- Binary/large/ignored files are skipped automatically.
- Compatible with any MCP client that supports stdio servers
  (Claude Code, Claude Desktop, CodeBuddy, custom clients using the
  official `mcp` SDK, etc.).

## Project layout

```
mcp-servers/
├── project_analysis_mcp.py          # thin launcher (kept for repo-local use)
└── project_analysis_mcp_pkg/        # publishable package (single source of truth)
    ├── pyproject.toml               # build + console entry point
    ├── README.md
    └── project_analysis_mcp/
        ├── __init__.py              # server + tools + main()
        └── __main__.py              # python -m project_analysis_mcp
```
