1{
2 lib,
3 accelerate,
4 buildPythonPackage,
5 docling,
6 fetchFromGitHub,
7 hatchling,
8 httpx,
9 llama-index-core,
10 llama-index-embeddings-huggingface,
11 llama-index-embeddings-openai,
12 llama-index-llms-openai-like,
13 llama-index-node-parser-docling,
14 llama-index-readers-docling,
15 llama-index-readers-file,
16 llama-index-vector-stores-milvus,
17 llama-index,
18 llama-stack-client,
19 mcp,
20 ollama,
21 pydantic-settings,
22 pydantic,
23 pytest-asyncio,
24 pytestCheckHook,
25 python-dotenv,
26 smolagents,
27 torch,
28 transformers,
29}:
30
31buildPythonPackage rec {
32 pname = "docling-mcp";
33 version = "1.3.1";
34 pyproject = true;
35
36 src = fetchFromGitHub {
37 owner = "docling-project";
38 repo = "docling-mcp";
39 tag = "v${version}";
40 hash = "sha256-MEGj/tPHDZqvgqmzXsoeEIWWU7vlLo8H4KhMFgf6q2c=";
41 };
42
43 pythonRemoveDeps = [
44 # Disabled due to circular dependency
45 "mellea"
46 ];
47
48 build-system = [ hatchling ];
49
50 dependencies = [
51 docling
52 httpx
53 mcp
54 pydantic
55 pydantic-settings
56 python-dotenv
57 ];
58
59 optional-dependencies = {
60 llama-index-rag = [
61 llama-index
62 llama-index-core
63 llama-index-embeddings-huggingface
64 llama-index-embeddings-openai
65 llama-index-llms-openai-like
66 llama-index-node-parser-docling
67 llama-index-readers-docling
68 llama-index-readers-file
69 llama-index-vector-stores-milvus
70 ];
71 llama-stack = [ llama-stack-client ];
72 smolagents = [
73 accelerate
74 ollama
75 smolagents
76 torch
77 transformers
78 ];
79 };
80
81 nativeCheckInputs = [
82 pytest-asyncio
83 pytestCheckHook
84 ];
85
86 pythonImportsCheck = [ "docling_mcp" ];
87
88 disabledTestPaths = [
89 # Tests require network access
90 "tests/test_mcp_server.py"
91 "tests/test_conversion_tools.py"
92 ];
93
94 meta = {
95 description = "Making docling agentic through MCP";
96 homepage = "https://github.com/docling-project/docling-mcp";
97 changelog = "https://github.com/docling-project/docling-mcp/blob/${src.tag}/CHANGELOG.md";
98 license = lib.licenses.mit;
99 maintainers = with lib.maintainers; [ fab ];
100 };
101}