Added a Dockerfile, and updated the README accordingly. Also added instructions for Claude Desktop
This commit is contained in:
parent
d351a9fd2e
commit
6a6f05a6a9
2 changed files with 92 additions and 1 deletions
32
packages/markitdown-mcp/Dockerfile
Normal file
32
packages/markitdown-mcp/Dockerfile
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
FROM python:3.13-slim-bullseye
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
ENV EXIFTOOL_PATH=/usr/bin/exiftool
|
||||||
|
ENV FFMPEG_PATH=/usr/bin/ffmpeg
|
||||||
|
|
||||||
|
# Runtime dependency
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
ffmpeg \
|
||||||
|
exiftool
|
||||||
|
|
||||||
|
ARG INSTALL_GIT=false
|
||||||
|
RUN if [ "$INSTALL_GIT" = "true" ]; then \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
git; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
RUN rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY . /app
|
||||||
|
RUN pip --no-cache-dir install /app
|
||||||
|
|
||||||
|
WORKDIR /workdir
|
||||||
|
|
||||||
|
# Default USERID and GROUPID
|
||||||
|
ARG USERID=nobody
|
||||||
|
ARG GROUPID=nogroup
|
||||||
|
|
||||||
|
USER $USERID:$GROUPID
|
||||||
|
|
||||||
|
ENTRYPOINT [ "markitdown-mcp" ]
|
||||||
|
|
@ -31,9 +31,68 @@ To run the MCP server, ussing SSE use the following command:
|
||||||
markitdown-mcp --sse --host 127.0.0.1 --port 3001
|
markitdown-mcp --sse --host 127.0.0.1 --port 3001
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Running in Docker
|
||||||
|
|
||||||
|
To run `markitdown-mcp` in Docker, build the Docker image using the provided Dockerfile:
|
||||||
|
```bash
|
||||||
|
docker build -t markitdown-mcp:latest .
|
||||||
|
```
|
||||||
|
|
||||||
|
And run it using:
|
||||||
|
```bash
|
||||||
|
docker run -it --rm markitdown-mcp:latest
|
||||||
|
```
|
||||||
|
This will be sufficient for remote URIs. To access local files, you need to mount the local directory into the container. For example, if you want to access files in `/home/user/data`, you can run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run -it --rm -v /home/user/data:/workdir markitdown-mcp:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
Once mounted, all files under data will be accessible under `/workdir` in the container. For example, if you have a file `example.txt` in `/home/user/data`, it will be accessible in the container at `/workdir/example.txt`.
|
||||||
|
|
||||||
## Accessing from Claude Desktop
|
## Accessing from Claude Desktop
|
||||||
|
|
||||||
TODO
|
It is recommended to use the Docker image when running the MCP server for Claude Desktop.
|
||||||
|
|
||||||
|
Follow [these instrutions](https://modelcontextprotocol.io/quickstart/user#for-claude-desktop-users) to access Claude's `claude_desktop_config.json` file.
|
||||||
|
|
||||||
|
Edit it to include the following JSON entry:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"mcpServers": {
|
||||||
|
"markitdown": {
|
||||||
|
"command": "docker",
|
||||||
|
"args": [
|
||||||
|
"run",
|
||||||
|
"--rm",
|
||||||
|
"-i",
|
||||||
|
"markitdown-mcp:latest"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
If you want to mount a directory, adjust it accordingly:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"mcpServers": {
|
||||||
|
"markitdown": {
|
||||||
|
"command": "docker",
|
||||||
|
"args": [
|
||||||
|
"run",
|
||||||
|
"--rm",
|
||||||
|
"-i",
|
||||||
|
"-v",
|
||||||
|
"/home/user/data:/workdir",
|
||||||
|
"markitdown-mcp:latest"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Debugging
|
## Debugging
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue