1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 hatchling,
8 tomli,
9
10 # dependencies
11 fastapi,
12 httpx,
13 mcp,
14 pydantic,
15 pydantic-settings,
16 requests,
17 rich,
18 typer,
19 uvicorn,
20
21 # tests
22 coverage,
23 pytest-asyncio,
24 pytest-cov-stub,
25 pytestCheckHook,
26}:
27
28buildPythonPackage rec {
29 pname = "fastapi-mcp";
30 version = "0.3.4";
31 pyproject = true;
32
33 src = fetchFromGitHub {
34 owner = "tadata-org";
35 repo = "fastapi_mcp";
36 tag = "v${version}";
37 hash = "sha256-t6p/jXQjbhUmIlwoqszRj3GGSrLS0Gcoh1BtizNaw8o=";
38 };
39
40 build-system = [
41 hatchling
42 tomli
43 ];
44
45 dependencies = [
46 fastapi
47 httpx
48 mcp
49 pydantic
50 pydantic-settings
51 requests
52 rich
53 tomli
54 typer
55 uvicorn
56 ];
57
58 pythonImportsCheck = [ "fastapi_mcp" ];
59
60 nativeCheckInputs = [
61 coverage
62 pytest-asyncio
63 pytest-cov-stub
64 pytestCheckHook
65 ];
66
67 __darwinAllowLocalNetworking = true;
68
69 meta = {
70 description = "Expose your FastAPI endpoints as Model Context Protocol (MCP) tools, with Auth";
71 homepage = "https://github.com/tadata-org/fastapi_mcp";
72 changelog = "https://github.com/tadata-org/fastapi_mcp/blob/v${version}/CHANGELOG.md";
73 license = lib.licenses.mit;
74 maintainers = with lib.maintainers; [ GaetanLepage ];
75 };
76}