Content
# Anytxt MCP Server
Based on [mcp-everything-search](https://github.com/201715648/mcp-everything-search) extension of Anytxt local document retrieval MCP server.
## Features
- **anytxt_search** - Search local document content, return file path and matching fragments
- **anytxt_get_context** - Get context fragments related to keywords in files
- **anytxt_read_file** - Read complete file content
- **anytxt_sync_index** - Synchronize specified folder to index
- **anytxt_ocr** - OCR recognize image text (requires Anytxt OCR version)
## Prerequisites
1. **Anytxt Software** - Download and install from [anytxt.net](https://anytxt.net/)
2. **Enable API** - In Anytxt: Help → API → Enable HTTP JSON-RPC API
3. **Python 3.10+** - Already installed
4. **uv** - Recommended package manager
## Quick Start
### 1. Install uv (if not installed)
```bash
# Windows
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
```
### 2. Clone Project
```bash
git clone https://github.com/201715648/mcp-everything-search.git
cd mcp-everything-search
```
### 3. Install Dependencies
```bash
uv sync
```
### 4. Configure Claude Desktop
Edit `claude_desktop_config.json`:
```json
{
"mcpServers": {
"anytxt-search": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-everything-search",
"run",
"mcp-server-everything-search"
],
"env": {
"ANYTXT_ENABLED": "true",
"ANYTXT_RPC_URL": "http://127.0.0.1:9920"
}
}
}
}
```
## Environment Variables
| Variable Name | Default Value | Description |
| --- | --- | --- |
| `ANYTXT_ENABLED` | `false` | Enable Anytxt mode |
| `ANYTXT_RPC_URL` | `http://127.0.0.1:9920` | Anytxt JSON-RPC address |
| `ANYTXT_DEFAULT_DIR` | Empty | Default search directory |
| `ANYTXT_DEFAULT_EXT` | `*` | Default file extension |
| `ANYTXT_TIMEOUT_MS` | `10000` | Request timeout (ms) |
| `ANYTXT_MAX_RESULTS` | `50` | Maximum search results |
| `ANYTXT_MAX_FRAGMENTS` | `20` | Maximum fragments |
| `ANYTXT_MAX_RAW_CHARS` | `20000` | Maximum returned characters |
| `ANYTXT_ENABLE_SYNC` | `false` | Enable index synchronization tool |
| `ANYTXT_ENABLE_OCR` | `false` | Enable OCR tool |
## Usage Examples
### Search Documents
```
User: Help me find the documentation for the authentication function
AI: [Call anytxt_search] Search "authentication function"
```
### Log Analysis
```
User: [Paste error log]
AI: [Analyze log] Found unknown error code, call anytxt_search to search related documents
```
### Code Understanding
```
User: What does this function do?
AI: [Read code] Encountered unfamiliar API, call anytxt_search to search documentation
```
## Search Syntax
Anytxt supports multiple search syntax:
- **Ordinary keywords**: `Hello`
- **Exact phrase**: `"This is"`
- **Boolean operations**: `Hello AND World`, `Hello OR World`, `NOT Hello`
- **Wildcard**: `*.txt`, `Hello*`
## Development
### Testing
```bash
# Run MCP Inspector
npx @modelcontextprotocol/inspector uv run mcp-server-everything-search
# Run unit tests
uv run pytest
```
### Code Quality
```bash
# Type checking
uv run pyright
# Code checking
uv run ruff check
# Code formatting
uv run ruff format
```
## License
MIT License - See [LICENSE](LICENSE) file
## Acknowledgements
- [mcp-everything-search](https://github.com/201715648/mcp-everything-search) - Base project
- [Anytxt](https://anytxt.net/) - Local document search engine
- [Model Context Protocol](https://modelcontextprotocol.io/) - MCP protocol