markitdown icon indicating copy to clipboard operation
markitdown copied to clipboard

Added FastAPI server to handle file conversion to markdown

Open dev-myk opened this issue 10 months ago • 2 comments

This PR introduces a FastAPI server that allows users to upload a file, which is then converted to Markdown using the Markitdown library.

What I Added:

  • A new server.py file implementing a FastAPI-based API.
  • A /convert endpoint that accepts file uploads and returns the Markdown conversion result.
  • Integration of the Markitdown library to process file contents.

How It Works:

  • Users send a POST request to /convert with a file as input.
  • The server reads the file content and passes it to Markitdown for conversion.
  • The API returns a JSON response containing the Markdown text.

dev-myk avatar Mar 10 '25 08:03 dev-myk

Thanks. I've been thinking about something like this -- especially for MCP use. But I've not yet decided how to proceed. I think I might advocate for a separate package. Let me think about this a little.

afourney avatar Mar 11 '25 05:03 afourney

There's now an mcp server

A more general FastAPI server would also be useful, perhaps. But I think I would recommend hosting that as a separate repo/project similar to how plugins are handled currently.

afourney avatar Mar 26 '25 17:03 afourney