Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/github-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Repository configuration for the GitHub Copilot app.
#
# The authoritative instructions for this repository are in AGENTS.md. This file
# points at them rather than restating them, so the two cannot drift apart.

instructions: |
Read AGENTS.md in the repository root and follow it, starting with the section
"Working in this repository". It is the authoritative guidance for this repository.

scripts:
- name: Validate
command: ruff format --check . && ruff check . && mypy markitdown_mcp/ && pytest tests/unit/
52 changes: 52 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,69 @@
# AI Agents Integration Guide

This guide provides comprehensive information for AI agents and assistants on how to effectively use the MarkItDown MCP server for document conversion tasks.

Check failure on line 3 in AGENTS.md

View workflow job for this annotation

GitHub Actions / Links, Spelling & Markdown

Line length

AGENTS.md:3:121 MD013/line-length Line length [Expected: 120; Actual: 157] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md013.md

## Working in this repository

Read this section before changing anything here. The rest of this file is a usage guide for agents that call the
server; this section is for agents that change its code.

### Layout

| Path | Purpose |
|---|---|
| `markitdown_mcp/` | The server package: `server.py` holds the MCP tools and the `main` entry point |
| `tests/` | Unit, integration, security, performance and compatibility tests |
| `schemas/` | Generated tool schemas. Never hand-edit; regenerate with `python scripts/generate-schemas.py` |
| `docs/` | Guides and API documentation. `docs/api/generated/` is produced by the documentation workflow |
| `.github/workflows/` | CI, release and maintenance automation. See [`RELEASE.md`](RELEASE.md) for the release pipeline |

### Validate before proposing a change

Set up with `pip install -e ".[dev,test]"`, then run all of these; every one must pass:

```sh
ruff format --check . && ruff check . && mypy markitdown_mcp/
pytest tests/unit/
```

The CI job `Unit Tests & Coverage` runs the same tests, and [`CONTRIBUTING.md`](CONTRIBUTING.md) describes the pull
request rules. Python 3.10 or later is required and is declared in `pyproject.toml`.

### Do not do these

- Do not rewrite history, force push, or delete branches.
- Do not commit secrets, tokens, or personal data. Push protection is enabled; a blocked push means stop and tell
the maintainer, not retry.
- Do not create or move tags, publish to PyPI, or run the release workflow. A release is made from a tag by the
pipeline described in [`RELEASE.md`](RELEASE.md), and the maintainer starts it.
- Do not change repository settings, branch protection, or the `pypi` environment. Those are maintainer actions.
- Do not hand-edit `schemas/*.json` or anything under `docs/api/generated/`; change the source and regenerate.
- Do not add a dependency without stating why in the pull request.
- The server reads and writes files on the user's machine. Do not add a code path that reads outside the paths the
caller supplies, and do not run `convert_directory` against a directory you were not asked to convert.

### Credentials

The repository holds no long-lived credential. Publishing to PyPI uses trusted publishing from the `pypi`
environment of `release.yml`, so there is no PyPI token to leak. If that trust is exposed, the maintainer removes
the publisher on pypi.org and re-adds it. The only other secrets are `GITHUB_TOKEN`, which GitHub issues per run,
and the optional `GITLEAKS_LICENSE`, which the maintainer replaces in the repository's secret settings.

### Attribution

Commits written by an agent carry a `Co-Authored-By` trailer naming the agent, and every change goes through a pull
request that a person can review. Nothing is pushed straight to `main`.

## 馃 Quick Reference for AI Agents

### Primary Use Cases
- Convert documents (PDF, Word, Excel, PowerPoint) to markdown

Check failure on line 60 in AGENTS.md

View workflow job for this annotation

GitHub Actions / Links, Spelling & Markdown

Lists should be surrounded by blank lines

AGENTS.md:60 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "- Convert documents (PDF, Word..."] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md032.md
- Extract readable text from various file formats
- Batch process directories of documents
- Support users with document analysis workflows

### Available Tools
1. **`convert_file`** - Convert individual files

Check failure on line 66 in AGENTS.md

View workflow job for this annotation

GitHub Actions / Links, Spelling & Markdown

Lists should be surrounded by blank lines

AGENTS.md:66 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "1. **`convert_file`** - Conver..."] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md032.md
2. **`convert_directory`** - Batch convert directories
3. **`list_supported_formats`** - Show supported formats

Expand All @@ -20,12 +72,12 @@
### `convert_file` Tool

**When to use:**
- User provides a file path for conversion

Check failure on line 75 in AGENTS.md

View workflow job for this annotation

GitHub Actions / Links, Spelling & Markdown

Lists should be surrounded by blank lines

AGENTS.md:75 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "- User provides a file path fo..."] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md032.md
- User shares base64 content that needs conversion
- Single document analysis required

**Parameters:**
```json

Check failure on line 80 in AGENTS.md

View workflow job for this annotation

GitHub Actions / Links, Spelling & Markdown

Fenced code blocks should be surrounded by blank lines

AGENTS.md:80 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```json"] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md031.md
{
"file_path": "/path/to/document.pdf", // For local files
"file_content": "base64encoded...", // For shared content
Expand All @@ -34,19 +86,19 @@
```

**Example scenarios:**
- "Convert this PDF to markdown"

Check failure on line 89 in AGENTS.md

View workflow job for this annotation

GitHub Actions / Links, Spelling & Markdown

Lists should be surrounded by blank lines

AGENTS.md:89 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "- "Convert this PDF to markdow..."] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md032.md
- "Extract text from this Word document"
- "Make this Excel file readable"

### `convert_directory` Tool

**When to use:**
- User wants to process multiple files

Check failure on line 96 in AGENTS.md

View workflow job for this annotation

GitHub Actions / Links, Spelling & Markdown

Lists should be surrounded by blank lines

AGENTS.md:96 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "- User wants to process multip..."] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md032.md
- Batch conversion workflows
- Directory cleanup/organization tasks

**Parameters:**
```json

Check failure on line 101 in AGENTS.md

View workflow job for this annotation

GitHub Actions / Links, Spelling & Markdown

Fenced code blocks should be surrounded by blank lines

AGENTS.md:101 MD031/blanks-around-fences Fenced code blocks should be surrounded by blank lines [Context: "```json"] https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md031.md
{
"input_directory": "/path/to/input",
"output_directory": "/path/to/output" // Optional
Expand Down
Loading