jobian's picture
Added Smoldocling Package and implemeted it's first test /parse
ceaf2e8
raw
history blame contribute delete
603 Bytes
from mcp.server.fastmcp import FastMCP
from fastapi import FastAPI
from smoldocling.cli import process_files
import json
# app = FastAPI()
mcp = FastMCP("Smoldocling Document Extractor")
@mcp.tool()
def extract_document(file_path: str) -> dict:
"""
Extract text and structure from a document at the given file path.
Returns a dictionary with the extracted document information as JSON.
"""
result = process_files([file_path], output_dir=None, output_format="json", verbose=False)
return result
# app.mount("/mcp", mcp)
if __name__ == "__main__":
mcp.run(transport='stdio')