summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/docling-mcp/default.nix
blob: 4e5f5599105d17d189ef3ce897c58445526e0aaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
{
  lib,
  accelerate,
  buildPythonPackage,
  docling,
  fetchFromGitHub,
  hatchling,
  httpx,
  llama-index-core,
  llama-index-embeddings-huggingface,
  llama-index-embeddings-openai,
  llama-index-llms-openai-like,
  llama-index-node-parser-docling,
  llama-index-readers-docling,
  llama-index-readers-file,
  llama-index-vector-stores-milvus,
  llama-index,
  llama-stack-client,
  mcp,
  ollama,
  pydantic-settings,
  pydantic,
  pytest-asyncio,
  pytestCheckHook,
  python-dotenv,
  smolagents,
  torch,
  transformers,
}:

buildPythonPackage rec {
  pname = "docling-mcp";
  version = "1.3.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "docling-project";
    repo = "docling-mcp";
    tag = "v${version}";
    hash = "sha256-MEGj/tPHDZqvgqmzXsoeEIWWU7vlLo8H4KhMFgf6q2c=";
  };

  pythonRemoveDeps = [
    # Disabled due to circular dependency
    "mellea"
  ];

  build-system = [ hatchling ];

  dependencies = [
    docling
    httpx
    mcp
    pydantic
    pydantic-settings
    python-dotenv
  ];

  optional-dependencies = {
    llama-index-rag = [
      llama-index
      llama-index-core
      llama-index-embeddings-huggingface
      llama-index-embeddings-openai
      llama-index-llms-openai-like
      llama-index-node-parser-docling
      llama-index-readers-docling
      llama-index-readers-file
      llama-index-vector-stores-milvus
    ];
    llama-stack = [ llama-stack-client ];
    smolagents = [
      accelerate
      ollama
      smolagents
      torch
      transformers
    ];
  };

  nativeCheckInputs = [
    pytest-asyncio
    pytestCheckHook
  ];

  pythonImportsCheck = [ "docling_mcp" ];

  disabledTestPaths = [
    # Tests require network access
    "tests/test_mcp_server.py"
    "tests/test_conversion_tools.py"
  ];

  meta = {
    description = "Making docling agentic through MCP";
    homepage = "https://github.com/docling-project/docling-mcp";
    changelog = "https://github.com/docling-project/docling-mcp/blob/${src.tag}/CHANGELOG.md";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ fab ];
  };
}