Skip to content

Feature/mcp#1545

Open
adeljck wants to merge 2 commits into
maurosoria:masterfrom
adeljck:feature/mcp
Open

Feature/mcp#1545
adeljck wants to merge 2 commits into
maurosoria:masterfrom
adeljck:feature/mcp

Conversation

@adeljck
Copy link
Copy Markdown

@adeljck adeljck commented May 16, 2026

feat: add MCP server mode for AI integration

Description

What will it do?

This PR introduces native support for the Model Context Protocol (MCP), enabling AI agents (like Cursor, Claude Desktop, etc.) to invoke dirsearch scans directly via STDIO or HTTP transport.

Key implementation details:

  • MCP Module: Implemented FastMCP server exposing dirsearch_scan and dirsearch_scan_cli tools.
  • Security: Added Bearer Token authentication (--mcp-token) with auto-generation support for HTTP mode.
  • Packaging: Updated PyInstaller specs and setup.py (pip install ".[mcp]") to include fastmcp dependencies.
  • Docker: Added Dockerfile.mcp for building MCP-enabled container images.
  • Docs & Tests: Updated README with client configuration examples and added 9 unit tests for MCP logic.

Requirements


  • Add your name to CONTRIBUTORS.md
  • If this is a new feature, then please add some additional information about it to CHANGELOG.md
  • All tests pass (python -m unittest tests)
  • Documentation is updated (README.md)

How to Use

1. Install Dependencies:

pip install -r requirements/mcp.txt

2. Run MCP Server:

# STDIO Mode (Local)
python3 dirsearch.py --mcp

# HTTP Mode (with Auth)
python3 dirsearch.py --mcp --mcp-transport http --mcp-token

# if leave mcp-token value empty,system will generate a token randomly.

Pics

image image image

adeljck added 2 commits May 16, 2026 20:44
- add FastMCP based server for AI integration
- add CLI arguments for MCP config and token auth
- add documentation for MCP mode and examples
- add unit tests for MCP server logic
2.update README.md
3.update mcp requirement file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant