deepresearch-flow 0.7.0__py3-none-any.whl → 0.7.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,4 +2,4 @@
2
2
 
3
3
  __all__ = ["__version__"]
4
4
 
5
- __version__ = "0.1.0"
5
+ __version__ = "0.7.1"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepresearch-flow
3
- Version: 0.7.0
3
+ Version: 0.7.1
4
4
  Summary: Workflow tools for paper extraction, review, and research automation.
5
5
  Author-email: DengQi <dengqi935@gmail.com>
6
6
  License: MIT License
@@ -520,7 +520,14 @@ server {
520
520
  }
521
521
 
522
522
  location /api/ {
523
- proxy_pass http://127.0.0.1:8001/;
523
+ proxy_pass http://127.0.0.1:8001;
524
+ proxy_set_header Host $host;
525
+ proxy_set_header X-Real-IP $remote_addr;
526
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
527
+ }
528
+
529
+ location ^~ /mcp {
530
+ proxy_pass http://127.0.0.1:8001;
524
531
  proxy_set_header Host $host;
525
532
  proxy_set_header X-Real-IP $remote_addr;
526
533
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -555,6 +562,147 @@ uv run deepresearch-flow paper db api serve \
555
562
  --host 0.0.0.0 --port 8001
556
563
  ```
557
564
 
565
+ ### 3.1) MCP (FastMCP Streamable HTTP)
566
+
567
+ This project exposes an MCP server mounted at `/mcp` on the snapshot API:
568
+
569
+ - Endpoint: `http://<host>:8001/mcp` (same host/port as `paper db api serve`)
570
+ - Transport: Streamable HTTP via `POST` only (no SSE; `GET` returns 405)
571
+ - Protocol header: optional `mcp-protocol-version` (`2025-03-26` or `2025-06-18`)
572
+ - Static reads: summary/source/translation are served as **text content** by reading snapshot static assets (local-first via `PAPER_DB_STATIC_EXPORT_DIR`, HTTP fallback via `PAPER_DB_STATIC_BASE` / `PAPER_DB_STATIC_BASE_URL`)
573
+
574
+ Optional (avoid HTTP fetch by reading exported assets directly on the API host):
575
+
576
+ ```bash
577
+ export PAPER_DB_STATIC_EXPORT_DIR=/data/paper-static
578
+ ```
579
+
580
+ #### MCP Tools (API functions)
581
+
582
+ <details>
583
+ <summary><strong>search_papers(query, limit=10)</strong> — full-text search (relevance-ranked)</summary>
584
+
585
+ - Args:
586
+ - `query` (str): keywords / topic query
587
+ - `limit` (int): number of results (clamped to API max page size)
588
+ - Returns: list of `{ paper_id, title, year, venue, snippet_markdown }`
589
+
590
+ </details>
591
+
592
+ <details>
593
+ <summary><strong>search_papers_by_keyword(keyword, limit=10)</strong> — facet keyword search</summary>
594
+
595
+ - Args:
596
+ - `keyword` (str): keyword substring
597
+ - `limit` (int): number of results (clamped)
598
+ - Returns: list of `{ paper_id, title, year, venue, snippet_markdown }`
599
+
600
+ </details>
601
+
602
+ <details>
603
+ <summary><strong>get_paper_metadata(paper_id)</strong> — metadata + available summary templates</summary>
604
+
605
+ - Args:
606
+ - `paper_id` (str)
607
+ - Returns: dict with:
608
+ - `paper_id`, `title`, `year`, `venue`
609
+ - `doi`, `arxiv_id`, `openreview_id`, `paper_pw_url`
610
+ - `preferred_summary_template`, `available_summary_templates`
611
+
612
+ </details>
613
+
614
+ <details>
615
+ <summary><strong>get_paper_summary(paper_id, template=None, max_chars=None)</strong> — summary JSON as raw text</summary>
616
+
617
+ - Notes:
618
+ - Uses `preferred_summary_template` if `template` is omitted
619
+ - Returns the **full JSON content** (not a URL)
620
+ - Args:
621
+ - `paper_id` (str)
622
+ - `template` (str | null)
623
+ - `max_chars` (int | null): truncation limit
624
+ - Returns: JSON string (may include a `[truncated: ...]` marker)
625
+
626
+ </details>
627
+
628
+ <details>
629
+ <summary><strong>get_paper_source(paper_id, max_chars=None)</strong> — source markdown as raw text</summary>
630
+
631
+ - Args:
632
+ - `paper_id` (str)
633
+ - `max_chars` (int | null): truncation limit
634
+ - Returns: markdown string (may include a `[truncated: ...]` marker)
635
+
636
+ </details>
637
+
638
+ <details>
639
+ <summary><strong>get_database_stats()</strong> — snapshot-level stats</summary>
640
+
641
+ - Returns:
642
+ - `total`
643
+ - `years`, `months`: list of `{ value, paper_count }`
644
+ - `authors`, `venues`, `institutions`, `keywords`, `tags`: top lists of `{ value, paper_count }`
645
+
646
+ </details>
647
+
648
+ <details>
649
+ <summary><strong>list_top_facets(category, limit=20)</strong> — top values for one facet</summary>
650
+
651
+ - Args:
652
+ - `category`: `author | venue | keyword | institution | tag`
653
+ - `limit` (int)
654
+ - Returns: list of `{ value, paper_count }`
655
+
656
+ </details>
657
+
658
+ <details>
659
+ <summary><strong>filter_papers(author=None, venue=None, year=None, keyword=None, tag=None, limit=10)</strong> — structured filtering</summary>
660
+
661
+ - Args (all optional except `limit`):
662
+ - `author`, `venue`, `keyword`, `tag`: substring match
663
+ - `year`: exact match
664
+ - `limit` (int): number of results (clamped)
665
+ - Returns: list of `{ paper_id, title, year, venue }`
666
+
667
+ </details>
668
+
669
+ #### MCP Resources (URI access)
670
+
671
+ <details>
672
+ <summary><strong>paper://{paper_id}/metadata</strong> — metadata JSON</summary>
673
+
674
+ Returns the same content as `get_paper_metadata(paper_id)` (as a JSON string).
675
+
676
+ </details>
677
+
678
+ <details>
679
+ <summary><strong>paper://{paper_id}/summary</strong> — preferred summary JSON</summary>
680
+
681
+ Returns the same content as `get_paper_summary(paper_id)` (preferred template; JSON string).
682
+
683
+ </details>
684
+
685
+ <details>
686
+ <summary><strong>paper://{paper_id}/summary/{template}</strong> — summary JSON for template</summary>
687
+
688
+ Returns the same content as `get_paper_summary(paper_id, template=template)` (JSON string).
689
+
690
+ </details>
691
+
692
+ <details>
693
+ <summary><strong>paper://{paper_id}/source</strong> — source markdown</summary>
694
+
695
+ Returns the same content as `get_paper_source(paper_id)` (markdown string).
696
+
697
+ </details>
698
+
699
+ <details>
700
+ <summary><strong>paper://{paper_id}/translation/{lang}</strong> — translated markdown</summary>
701
+
702
+ Returns translated markdown for `lang` (e.g. `zh`, `ja`) when available.
703
+
704
+ </details>
705
+
558
706
  ### 4) Frontend (static build or dev)
559
707
 
560
708
  ```bash
@@ -811,7 +959,7 @@ docker run --rm -p 8899:8899 \
811
959
  ```
812
960
 
813
961
  Notes:
814
- - nginx listens on 8899 and proxies `/api` to the internal API at `127.0.0.1:8000`.
962
+ - nginx listens on 8899 and proxies `/api` and `/mcp` to the internal API at `127.0.0.1:8000`.
815
963
  - Mount your snapshot DB to `/db/papers.db` inside the container.
816
964
  - Mount snapshot static assets to `/static` when serving assets from this container (default `PAPER_DB_STATIC_BASE` is `/static`).
817
965
  - If `PAPER_DB_STATIC_BASE` is a full URL (e.g. `https://static.example.com`), nginx still serves the frontend locally, while API responses use that external static base for asset links.
@@ -1,4 +1,4 @@
1
- deepresearch_flow/__init__.py,sha256=rjP9ES4zJCfEN_MCDYAYPL1mNJZGjojdmbRwnZ9FlEk,83
1
+ deepresearch_flow/__init__.py,sha256=kes-OKst6kwiFPY1FmyOV1E5dHTyyHBCM3Iy0EdDp8g,83
2
2
  deepresearch_flow/__main__.py,sha256=Ceo0rMTOhHhwFPD-HyDDagenNsmWEzPmsdYLI7kwKVA,115
3
3
  deepresearch_flow/cli.py,sha256=t4oowCNWldL0DrVJ4d0UlRkuGU2qHej_G0mAc_quteQ,455
4
4
  deepresearch_flow/paper/__init__.py,sha256=sunaOkcgAJBrfmcaJTumcWbPGVUSGWvOv2a2Yidzy0A,43
@@ -466,9 +466,9 @@ deepresearch_flow/translator/placeholder.py,sha256=mEgqA-dPdOsIhno0h_hzfpXpY2asb
466
466
  deepresearch_flow/translator/prompts.py,sha256=EvfBvBIpQXARDj4m87GAyFXJGL8EJeahj_rOmp9mv68,5556
467
467
  deepresearch_flow/translator/protector.py,sha256=yUMuS2FgVofK_MRXrcauLRiwNvdCCjNAnh6CcNd686o,11777
468
468
  deepresearch_flow/translator/segment.py,sha256=rBFMCLTrvm2GrPc_hNFymi-8Ih2DAtUQlZHCRE9nLaM,5146
469
- deepresearch_flow-0.7.0.dist-info/licenses/LICENSE,sha256=hT8F2Py1pe6flxq3Ufdm2UKFk0B8CBm0aAQfsLXfvjw,1063
470
- deepresearch_flow-0.7.0.dist-info/METADATA,sha256=aluWW1CXPeSWCLKopChdbgl_GHEQHByua1fBohr6Mzg,26728
471
- deepresearch_flow-0.7.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
472
- deepresearch_flow-0.7.0.dist-info/entry_points.txt,sha256=1uIKscs0YRMg_mFsg9NjsaTt4CvQqQ_-zGERUKhhL_Y,65
473
- deepresearch_flow-0.7.0.dist-info/top_level.txt,sha256=qBl4RvPJNJUbL8CFfMNWxY0HpQLx5RlF_ko-z_aKpm0,18
474
- deepresearch_flow-0.7.0.dist-info/RECORD,,
469
+ deepresearch_flow-0.7.1.dist-info/licenses/LICENSE,sha256=hT8F2Py1pe6flxq3Ufdm2UKFk0B8CBm0aAQfsLXfvjw,1063
470
+ deepresearch_flow-0.7.1.dist-info/METADATA,sha256=rSmAZMSVrjhXLo6Dte3Gaf9AvVyznUaHd-Ahwn47Ne4,31331
471
+ deepresearch_flow-0.7.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
472
+ deepresearch_flow-0.7.1.dist-info/entry_points.txt,sha256=1uIKscs0YRMg_mFsg9NjsaTt4CvQqQ_-zGERUKhhL_Y,65
473
+ deepresearch_flow-0.7.1.dist-info/top_level.txt,sha256=qBl4RvPJNJUbL8CFfMNWxY0HpQLx5RlF_ko-z_aKpm0,18
474
+ deepresearch_flow-0.7.1.dist-info/RECORD,,