litdb 2.2.2__tar.gz → 2.2.4__tar.gz
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.
- {litdb-2.2.2/src/litdb.egg-info → litdb-2.2.4}/PKG-INFO +106 -14
- {litdb-2.2.2 → litdb-2.2.4}/README.org +100 -6
- {litdb-2.2.2 → litdb-2.2.4}/pyproject.toml +19 -10
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/app.py +65 -54
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/audio.py +12 -11
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/chat.py +9 -5
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/cli.py +9 -12
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/coa.py +8 -11
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/commands/data_processing.py +3 -3
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/commands/export.py +2 -3
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/commands/filters.py +5 -2
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/commands/install.py +9 -4
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/commands/manage.py +8 -8
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/commands/openalex_commands.py +2 -3
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/commands/research_commands.py +12 -12
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/commands/review.py +0 -1
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/commands/search.py +39 -19
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/commands/tags.py +0 -1
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/crawl.py +8 -9
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/db.py +25 -23
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/doe_collaborators.py +6 -7
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/extract.py +9 -10
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/gpt.py +10 -4
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/images.py +7 -5
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/lab.py +2 -1
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/lsearch.py +3 -2
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/mcp_server.py +68 -33
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/openalex.py +12 -7
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/server.py +1 -2
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/summary.py +5 -5
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/utils.py +2 -1
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/youtube.py +2 -1
- {litdb-2.2.2 → litdb-2.2.4/src/litdb.egg-info}/PKG-INFO +106 -14
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb.egg-info/requires.txt +4 -7
- {litdb-2.2.2 → litdb-2.2.4}/LICENSE +0 -0
- {litdb-2.2.2 → litdb-2.2.4}/setup.cfg +0 -0
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/__init__.py +2 -2
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/bibtex.py +0 -0
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/commands/__init__.py +0 -0
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/commands/utilities.py +1 -1
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/pdf.py +2 -2
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb/research.py +4 -4
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb.egg-info/SOURCES.txt +0 -0
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb.egg-info/dependency_links.txt +0 -0
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb.egg-info/entry_points.txt +0 -0
- {litdb-2.2.2 → litdb-2.2.4}/src/litdb.egg-info/top_level.txt +0 -0
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: litdb
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.4
|
|
4
4
|
Summary: A literature database tool with GPT integration.
|
|
5
5
|
Author-email: John Kitchin <jkitchin@andrew.cmu.edu>
|
|
6
6
|
Maintainer-email: John Kitchin <jkitchin@andrew.cmu.edu>
|
|
7
7
|
License-Expression: MIT
|
|
8
8
|
Project-URL: Homepage, https://github.com/jkitchin/litdb
|
|
9
|
+
Requires-Python: >=3.11
|
|
9
10
|
Description-Content-Type: text/plain
|
|
10
11
|
License-File: LICENSE
|
|
11
12
|
Requires-Dist: toml
|
|
@@ -36,14 +37,13 @@ Requires-Dist: pillow
|
|
|
36
37
|
Requires-Dist: bibtexparser<2
|
|
37
38
|
Requires-Dist: pandas
|
|
38
39
|
Requires-Dist: more-itertools
|
|
39
|
-
Requires-Dist: nameparser
|
|
40
|
+
Requires-Dist: nameparser<3
|
|
40
41
|
Requires-Dist: tabulate
|
|
41
42
|
Requires-Dist: IPython
|
|
42
43
|
Requires-Dist: gmft
|
|
43
|
-
Requires-Dist: ruff>=0.13.3
|
|
44
44
|
Requires-Dist: torch
|
|
45
45
|
Requires-Dist: torchvision
|
|
46
|
-
Requires-Dist:
|
|
46
|
+
Requires-Dist: mcp<2,>=1.22
|
|
47
47
|
Provides-Extra: test
|
|
48
48
|
Requires-Dist: pytest>=8.0.0; extra == "test"
|
|
49
49
|
Requires-Dist: pytest-cov>=4.1.0; extra == "test"
|
|
@@ -60,7 +60,6 @@ Requires-Dist: langchain_google_genai; extra == "research"
|
|
|
60
60
|
Requires-Dist: langchain_anthropic; extra == "research"
|
|
61
61
|
Requires-Dist: mistune; extra == "research"
|
|
62
62
|
Requires-Dist: htmldocx; extra == "research"
|
|
63
|
-
Requires-Dist: docx; extra == "research"
|
|
64
63
|
Requires-Dist: md2pdf; extra == "research"
|
|
65
64
|
Requires-Dist: pypandoc; extra == "research"
|
|
66
65
|
Provides-Extra: app
|
|
@@ -75,7 +74,7 @@ Provides-Extra: image
|
|
|
75
74
|
Requires-Dist: pyperclip; extra == "image"
|
|
76
75
|
Requires-Dist: pillow_heif; extra == "image"
|
|
77
76
|
Provides-Extra: mcp
|
|
78
|
-
Requires-Dist: mcp[cli]; extra == "mcp"
|
|
77
|
+
Requires-Dist: mcp[cli]<2,>=1.22; extra == "mcp"
|
|
79
78
|
Provides-Extra: audio
|
|
80
79
|
Requires-Dist: pyaudio; extra == "audio"
|
|
81
80
|
Requires-Dist: SpeechRecognition; extra == "audio"
|
|
@@ -88,7 +87,6 @@ Requires-Dist: langchain_google_genai; extra == "all"
|
|
|
88
87
|
Requires-Dist: langchain_anthropic; extra == "all"
|
|
89
88
|
Requires-Dist: mistune; extra == "all"
|
|
90
89
|
Requires-Dist: htmldocx; extra == "all"
|
|
91
|
-
Requires-Dist: docx; extra == "all"
|
|
92
90
|
Requires-Dist: md2pdf; extra == "all"
|
|
93
91
|
Requires-Dist: pypandoc; extra == "all"
|
|
94
92
|
Requires-Dist: streamlit; extra == "all"
|
|
@@ -98,7 +96,7 @@ Requires-Dist: scrapy; extra == "all"
|
|
|
98
96
|
Requires-Dist: backoff; extra == "all"
|
|
99
97
|
Requires-Dist: pyperclip; extra == "all"
|
|
100
98
|
Requires-Dist: pillow_heif; extra == "all"
|
|
101
|
-
Requires-Dist: mcp[cli]; extra == "all"
|
|
99
|
+
Requires-Dist: mcp[cli]<2,>=1.22; extra == "all"
|
|
102
100
|
Requires-Dist: pyaudio; extra == "all"
|
|
103
101
|
Requires-Dist: SpeechRecognition; extra == "all"
|
|
104
102
|
Dynamic: license-file
|
|
@@ -111,7 +109,18 @@ Dynamic: license-file
|
|
|
111
109
|
<a href="https://github.com/jkitchin/litdb/actions/workflows/build.yml">
|
|
112
110
|
<img src="https://github.com/jkitchin/litdb/actions/workflows/build.yml/badge.svg" alt="Build Status">
|
|
113
111
|
</a>
|
|
114
|
-
<
|
|
112
|
+
<a href="https://github.com/jkitchin/litdb/actions/workflows/test.yml">
|
|
113
|
+
<img src="https://github.com/jkitchin/litdb/actions/workflows/test.yml/badge.svg" alt="CI">
|
|
114
|
+
</a>
|
|
115
|
+
<a href="https://pypi.org/project/litdb/">
|
|
116
|
+
<img src="https://img.shields.io/pypi/v/litdb.svg" alt="PyPI">
|
|
117
|
+
</a>
|
|
118
|
+
<a href="https://pepy.tech/projects/litdb">
|
|
119
|
+
<img src="https://static.pepy.tech/personalized-badge/litdb?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads" alt="PyPI Downloads">
|
|
120
|
+
</a>
|
|
121
|
+
<a href="https://doi.org/10.5281/zenodo.23514948">
|
|
122
|
+
<img src="https://img.shields.io/badge/DOI-10.5281%2Fzenodo.23514948-blue.svg" alt="DOI">
|
|
123
|
+
</a>
|
|
115
124
|
#+END_HTML
|
|
116
125
|
|
|
117
126
|
* litdb concept
|
|
@@ -158,7 +167,13 @@ source .venv/bin/activate
|
|
|
158
167
|
uv pip install litdb
|
|
159
168
|
#+END_SRC
|
|
160
169
|
|
|
161
|
-
You have to activate that virtual env to use litdb, which may be annoying.
|
|
170
|
+
You have to activate that virtual env to use litdb, which may be annoying. An alternative is to install litdb as a uv tool, which puts ~litdb~ and ~litdb_mcp~ on your PATH in their own environment:
|
|
171
|
+
|
|
172
|
+
#+BEGIN_SRC sh
|
|
173
|
+
uv tool install litdb
|
|
174
|
+
#+END_SRC
|
|
175
|
+
|
|
176
|
+
This is also the easiest way to make the MCP server available to AI agents. See [[*Using litdb with AI agents (skill and MCP server)]].
|
|
162
177
|
|
|
163
178
|
** Recent additions
|
|
164
179
|
|
|
@@ -811,16 +826,93 @@ litdb schema paper.pdf '{"title": ["str", None], "year": ["int", 2024]}'
|
|
|
811
826
|
|
|
812
827
|
The schema command first converts the document to markdown using Docling, then uses an LLM with structured output to extract the requested fields. The LLM model used is configured in the ~[llm]~ section of your ~litdb.toml~ file.
|
|
813
828
|
|
|
814
|
-
**
|
|
829
|
+
** Using litdb with AI agents (skill and MCP server)
|
|
830
|
+
|
|
831
|
+
litdb comes with two things for AI coding agents such as Claude Code, VS Code (GitHub Copilot), Cursor, Codex, OpenCode and Gemini CLI:
|
|
832
|
+
|
|
833
|
+
- An *agent skill* ([[./skills/litdb/SKILL.md][skills/litdb/SKILL.md]]) that teaches the agent how to use the litdb CLI: adding papers, searching, filters, tags, exporting BibTeX, and so on.
|
|
834
|
+
- An *MCP server* (~litdb_mcp~) that gives the agent direct, read-only tools for your database: ~vsearch~, ~fulltext_search~, ~find_similar~, ~openalex~, ~get_source_details~, ~get_citation~, ~get_bibtex~, ~list_tags~, ~get_tagged_articles~ and ~generate_nsf_coa~.
|
|
835
|
+
|
|
836
|
+
The easiest way to install both is [[https://github.com/jkitchin/knowhow][knowhow]], which needs nothing installed besides [[https://github.com/astral-sh/uv][uv]]. The skill follows the [[https://agentskills.io/specification][Agent Skills specification]], so it also works with ~npx skills~.
|
|
837
|
+
|
|
838
|
+
*** Install the skill
|
|
839
|
+
|
|
840
|
+
#+BEGIN_SRC sh
|
|
841
|
+
# See what litdb offers
|
|
842
|
+
uvx knowhow add jkitchin/litdb --list
|
|
843
|
+
|
|
844
|
+
# Install the skill in the current project
|
|
845
|
+
uvx knowhow add jkitchin/litdb --skill litdb
|
|
846
|
+
|
|
847
|
+
# or for your user, in every project
|
|
848
|
+
uvx knowhow add jkitchin/litdb --skill litdb -g
|
|
849
|
+
#+END_SRC
|
|
850
|
+
|
|
851
|
+
The skill is copied to ~.agents/skills/litdb~ (read by VS Code, Codex, OpenCode, Gemini CLI, Cursor and Copilot) and linked into ~.claude/skills/litdb~ for Claude Code. Then ask your agent things like "add the references of 10.1021/jp047349j to my litdb" or "make a bibtex file of everything tagged thesis".
|
|
852
|
+
|
|
853
|
+
Keep it up to date with ~uvx knowhow check~ and ~uvx knowhow upgrade~, and remove it with ~uvx knowhow remove litdb~.
|
|
854
|
+
|
|
855
|
+
If you work from a clone of this repository, ~litdb install claude-skill~ also copies the skill to ~~/.claude/skills/litdb~.
|
|
856
|
+
|
|
857
|
+
*** Install the MCP server
|
|
858
|
+
|
|
859
|
+
The MCP server runs the ~litdb_mcp~ command, so first make sure it is on your PATH (~uv tool install litdb~ does this). The server is defined in [[./mcp/litdb.json][mcp/litdb.json]], and knowhow translates it into each agent's config format:
|
|
815
860
|
|
|
816
861
|
#+BEGIN_SRC sh
|
|
817
|
-
|
|
862
|
+
# Claude Code, in this project (writes .mcp.json)
|
|
863
|
+
uvx knowhow add jkitchin/litdb --mcp litdb -a claude-code
|
|
864
|
+
|
|
865
|
+
# Claude Code for all your projects
|
|
866
|
+
uvx knowhow add jkitchin/litdb --mcp litdb -a claude-code -g
|
|
867
|
+
|
|
868
|
+
# Several agents at once
|
|
869
|
+
uvx knowhow add jkitchin/litdb --mcp litdb -a claude-code -a vscode -a cursor -a codex
|
|
818
870
|
#+END_SRC
|
|
819
871
|
|
|
820
|
-
|
|
872
|
+
knowhow shows you the server config and asks for confirmation before installing it (add ~-y~ to skip the prompt).
|
|
873
|
+
|
|
874
|
+
The server needs to know which database to use. It looks for:
|
|
875
|
+
|
|
876
|
+
1. the ~litdb~ environment variable, the path to a ~litdb.libsql~ file;
|
|
877
|
+
2. a ~litdb.toml~ in the agent's working directory or one of its parents;
|
|
878
|
+
3. the ~LITDB_ROOT~ environment variable, the directory that contains ~litdb.toml~.
|
|
879
|
+
|
|
880
|
+
The installed config passes ~LITDB_ROOT~ through from your environment, so set it in your shell profile before starting the agent:
|
|
881
|
+
|
|
882
|
+
#+BEGIN_SRC sh
|
|
883
|
+
export LITDB_ROOT=~/litdb # the directory with litdb.toml and litdb.libsql
|
|
884
|
+
#+END_SRC
|
|
885
|
+
|
|
886
|
+
To check it works in Claude Code, run ~/mcp~ and look for ~litdb~, or ask "what is in my litdb about alloy segregation?". Remove the server with ~uvx knowhow remove --mcp litdb~.
|
|
887
|
+
|
|
888
|
+
If you prefer to configure an agent by hand, this is the config (Claude Code ~.mcp.json~ format):
|
|
821
889
|
|
|
822
|
-
|
|
890
|
+
#+BEGIN_SRC json
|
|
891
|
+
{
|
|
892
|
+
"mcpServers": {
|
|
893
|
+
"litdb": {
|
|
894
|
+
"command": "litdb_mcp",
|
|
895
|
+
"env": {"LITDB_ROOT": "/path/to/your/litdb"}
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
#+END_SRC
|
|
900
|
+
|
|
901
|
+
or with the Claude Code CLI:
|
|
902
|
+
|
|
903
|
+
#+BEGIN_SRC sh
|
|
904
|
+
claude mcp add litdb --scope user -e LITDB_ROOT=/path/to/your/litdb -- litdb_mcp
|
|
905
|
+
#+END_SRC
|
|
906
|
+
|
|
907
|
+
*** Claude Desktop
|
|
908
|
+
|
|
909
|
+
Claude Desktop is not supported by knowhow. Instead, run this from your litdb directory (the one with ~litdb.toml~), or pass ~--db /path/to/litdb.libsql~:
|
|
910
|
+
|
|
911
|
+
#+BEGIN_SRC sh
|
|
912
|
+
litdb install mcp-server
|
|
913
|
+
#+END_SRC
|
|
823
914
|
|
|
915
|
+
Then restart Claude Desktop. Now you can use prompts like "Search my litdb for references on alloy segregation" or "Search OpenAlex for articles on alloy segregation." Uninstall it with ~litdb install uninstall-mcp~.
|
|
824
916
|
|
|
825
917
|
* Adding local files
|
|
826
918
|
|
|
@@ -6,7 +6,18 @@
|
|
|
6
6
|
<a href="https://github.com/jkitchin/litdb/actions/workflows/build.yml">
|
|
7
7
|
<img src="https://github.com/jkitchin/litdb/actions/workflows/build.yml/badge.svg" alt="Build Status">
|
|
8
8
|
</a>
|
|
9
|
-
<
|
|
9
|
+
<a href="https://github.com/jkitchin/litdb/actions/workflows/test.yml">
|
|
10
|
+
<img src="https://github.com/jkitchin/litdb/actions/workflows/test.yml/badge.svg" alt="CI">
|
|
11
|
+
</a>
|
|
12
|
+
<a href="https://pypi.org/project/litdb/">
|
|
13
|
+
<img src="https://img.shields.io/pypi/v/litdb.svg" alt="PyPI">
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://pepy.tech/projects/litdb">
|
|
16
|
+
<img src="https://static.pepy.tech/personalized-badge/litdb?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=GREEN&left_text=downloads" alt="PyPI Downloads">
|
|
17
|
+
</a>
|
|
18
|
+
<a href="https://doi.org/10.5281/zenodo.23514948">
|
|
19
|
+
<img src="https://img.shields.io/badge/DOI-10.5281%2Fzenodo.23514948-blue.svg" alt="DOI">
|
|
20
|
+
</a>
|
|
10
21
|
#+END_HTML
|
|
11
22
|
|
|
12
23
|
* litdb concept
|
|
@@ -53,7 +64,13 @@ source .venv/bin/activate
|
|
|
53
64
|
uv pip install litdb
|
|
54
65
|
#+END_SRC
|
|
55
66
|
|
|
56
|
-
You have to activate that virtual env to use litdb, which may be annoying.
|
|
67
|
+
You have to activate that virtual env to use litdb, which may be annoying. An alternative is to install litdb as a uv tool, which puts ~litdb~ and ~litdb_mcp~ on your PATH in their own environment:
|
|
68
|
+
|
|
69
|
+
#+BEGIN_SRC sh
|
|
70
|
+
uv tool install litdb
|
|
71
|
+
#+END_SRC
|
|
72
|
+
|
|
73
|
+
This is also the easiest way to make the MCP server available to AI agents. See [[*Using litdb with AI agents (skill and MCP server)]].
|
|
57
74
|
|
|
58
75
|
** Recent additions
|
|
59
76
|
|
|
@@ -706,16 +723,93 @@ litdb schema paper.pdf '{"title": ["str", None], "year": ["int", 2024]}'
|
|
|
706
723
|
|
|
707
724
|
The schema command first converts the document to markdown using Docling, then uses an LLM with structured output to extract the requested fields. The LLM model used is configured in the ~[llm]~ section of your ~litdb.toml~ file.
|
|
708
725
|
|
|
709
|
-
**
|
|
726
|
+
** Using litdb with AI agents (skill and MCP server)
|
|
727
|
+
|
|
728
|
+
litdb comes with two things for AI coding agents such as Claude Code, VS Code (GitHub Copilot), Cursor, Codex, OpenCode and Gemini CLI:
|
|
729
|
+
|
|
730
|
+
- An *agent skill* ([[./skills/litdb/SKILL.md][skills/litdb/SKILL.md]]) that teaches the agent how to use the litdb CLI: adding papers, searching, filters, tags, exporting BibTeX, and so on.
|
|
731
|
+
- An *MCP server* (~litdb_mcp~) that gives the agent direct, read-only tools for your database: ~vsearch~, ~fulltext_search~, ~find_similar~, ~openalex~, ~get_source_details~, ~get_citation~, ~get_bibtex~, ~list_tags~, ~get_tagged_articles~ and ~generate_nsf_coa~.
|
|
732
|
+
|
|
733
|
+
The easiest way to install both is [[https://github.com/jkitchin/knowhow][knowhow]], which needs nothing installed besides [[https://github.com/astral-sh/uv][uv]]. The skill follows the [[https://agentskills.io/specification][Agent Skills specification]], so it also works with ~npx skills~.
|
|
734
|
+
|
|
735
|
+
*** Install the skill
|
|
736
|
+
|
|
737
|
+
#+BEGIN_SRC sh
|
|
738
|
+
# See what litdb offers
|
|
739
|
+
uvx knowhow add jkitchin/litdb --list
|
|
740
|
+
|
|
741
|
+
# Install the skill in the current project
|
|
742
|
+
uvx knowhow add jkitchin/litdb --skill litdb
|
|
743
|
+
|
|
744
|
+
# or for your user, in every project
|
|
745
|
+
uvx knowhow add jkitchin/litdb --skill litdb -g
|
|
746
|
+
#+END_SRC
|
|
747
|
+
|
|
748
|
+
The skill is copied to ~.agents/skills/litdb~ (read by VS Code, Codex, OpenCode, Gemini CLI, Cursor and Copilot) and linked into ~.claude/skills/litdb~ for Claude Code. Then ask your agent things like "add the references of 10.1021/jp047349j to my litdb" or "make a bibtex file of everything tagged thesis".
|
|
749
|
+
|
|
750
|
+
Keep it up to date with ~uvx knowhow check~ and ~uvx knowhow upgrade~, and remove it with ~uvx knowhow remove litdb~.
|
|
751
|
+
|
|
752
|
+
If you work from a clone of this repository, ~litdb install claude-skill~ also copies the skill to ~~/.claude/skills/litdb~.
|
|
753
|
+
|
|
754
|
+
*** Install the MCP server
|
|
755
|
+
|
|
756
|
+
The MCP server runs the ~litdb_mcp~ command, so first make sure it is on your PATH (~uv tool install litdb~ does this). The server is defined in [[./mcp/litdb.json][mcp/litdb.json]], and knowhow translates it into each agent's config format:
|
|
710
757
|
|
|
711
758
|
#+BEGIN_SRC sh
|
|
712
|
-
|
|
759
|
+
# Claude Code, in this project (writes .mcp.json)
|
|
760
|
+
uvx knowhow add jkitchin/litdb --mcp litdb -a claude-code
|
|
761
|
+
|
|
762
|
+
# Claude Code for all your projects
|
|
763
|
+
uvx knowhow add jkitchin/litdb --mcp litdb -a claude-code -g
|
|
764
|
+
|
|
765
|
+
# Several agents at once
|
|
766
|
+
uvx knowhow add jkitchin/litdb --mcp litdb -a claude-code -a vscode -a cursor -a codex
|
|
713
767
|
#+END_SRC
|
|
714
768
|
|
|
715
|
-
|
|
769
|
+
knowhow shows you the server config and asks for confirmation before installing it (add ~-y~ to skip the prompt).
|
|
770
|
+
|
|
771
|
+
The server needs to know which database to use. It looks for:
|
|
772
|
+
|
|
773
|
+
1. the ~litdb~ environment variable, the path to a ~litdb.libsql~ file;
|
|
774
|
+
2. a ~litdb.toml~ in the agent's working directory or one of its parents;
|
|
775
|
+
3. the ~LITDB_ROOT~ environment variable, the directory that contains ~litdb.toml~.
|
|
776
|
+
|
|
777
|
+
The installed config passes ~LITDB_ROOT~ through from your environment, so set it in your shell profile before starting the agent:
|
|
778
|
+
|
|
779
|
+
#+BEGIN_SRC sh
|
|
780
|
+
export LITDB_ROOT=~/litdb # the directory with litdb.toml and litdb.libsql
|
|
781
|
+
#+END_SRC
|
|
782
|
+
|
|
783
|
+
To check it works in Claude Code, run ~/mcp~ and look for ~litdb~, or ask "what is in my litdb about alloy segregation?". Remove the server with ~uvx knowhow remove --mcp litdb~.
|
|
784
|
+
|
|
785
|
+
If you prefer to configure an agent by hand, this is the config (Claude Code ~.mcp.json~ format):
|
|
716
786
|
|
|
717
|
-
|
|
787
|
+
#+BEGIN_SRC json
|
|
788
|
+
{
|
|
789
|
+
"mcpServers": {
|
|
790
|
+
"litdb": {
|
|
791
|
+
"command": "litdb_mcp",
|
|
792
|
+
"env": {"LITDB_ROOT": "/path/to/your/litdb"}
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
#+END_SRC
|
|
797
|
+
|
|
798
|
+
or with the Claude Code CLI:
|
|
799
|
+
|
|
800
|
+
#+BEGIN_SRC sh
|
|
801
|
+
claude mcp add litdb --scope user -e LITDB_ROOT=/path/to/your/litdb -- litdb_mcp
|
|
802
|
+
#+END_SRC
|
|
803
|
+
|
|
804
|
+
*** Claude Desktop
|
|
805
|
+
|
|
806
|
+
Claude Desktop is not supported by knowhow. Instead, run this from your litdb directory (the one with ~litdb.toml~), or pass ~--db /path/to/litdb.libsql~:
|
|
807
|
+
|
|
808
|
+
#+BEGIN_SRC sh
|
|
809
|
+
litdb install mcp-server
|
|
810
|
+
#+END_SRC
|
|
718
811
|
|
|
812
|
+
Then restart Claude Desktop. Now you can use prompts like "Search my litdb for references on alloy segregation" or "Search OpenAlex for articles on alloy segregation." Uninstall it with ~litdb install uninstall-mcp~.
|
|
719
813
|
|
|
720
814
|
* Adding local files
|
|
721
815
|
|
|
@@ -7,7 +7,7 @@ where = ["src"]
|
|
|
7
7
|
|
|
8
8
|
[project]
|
|
9
9
|
name = "litdb"
|
|
10
|
-
version = "2.2.
|
|
10
|
+
version = "2.2.4"
|
|
11
11
|
authors = [
|
|
12
12
|
{name = "John Kitchin", email = "jkitchin@andrew.cmu.edu"},
|
|
13
13
|
]
|
|
@@ -16,6 +16,7 @@ maintainers = [
|
|
|
16
16
|
]
|
|
17
17
|
description = "A literature database tool with GPT integration."
|
|
18
18
|
license = "MIT"
|
|
19
|
+
requires-python = ">=3.11"
|
|
19
20
|
readme = {file = "README.org", content-type = "text/plain"}
|
|
20
21
|
dependencies = [
|
|
21
22
|
# Core dependencies - always installed
|
|
@@ -48,16 +49,20 @@ dependencies = [
|
|
|
48
49
|
# Data processing and COA
|
|
49
50
|
"pandas",
|
|
50
51
|
"more-itertools",
|
|
51
|
-
"nameparser",
|
|
52
|
+
"nameparser<3", # 3.0 removed HumanName (used in coa.py, doe_collaborators.py)
|
|
52
53
|
"tabulate",
|
|
53
54
|
"IPython",
|
|
54
55
|
# Table extraction
|
|
55
56
|
"gmft",
|
|
56
|
-
# Development tools
|
|
57
|
-
"ruff>=0.13.3",
|
|
58
57
|
"torch",
|
|
59
58
|
"torchvision",
|
|
60
|
-
|
|
59
|
+
# mcp 2.x removed mcp.server.fastmcp, which mcp_server.py uses
|
|
60
|
+
"mcp>=1.22,<2",
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
[dependency-groups]
|
|
64
|
+
dev = [
|
|
65
|
+
"ruff>=0.17.5",
|
|
61
66
|
]
|
|
62
67
|
|
|
63
68
|
[project.scripts]
|
|
@@ -91,7 +96,6 @@ research = [
|
|
|
91
96
|
"langchain_anthropic",
|
|
92
97
|
"mistune",
|
|
93
98
|
"htmldocx",
|
|
94
|
-
"docx",
|
|
95
99
|
"md2pdf",
|
|
96
100
|
"pypandoc",
|
|
97
101
|
]
|
|
@@ -121,7 +125,7 @@ image = [
|
|
|
121
125
|
|
|
122
126
|
# MCP server for Claude Desktop
|
|
123
127
|
mcp = [
|
|
124
|
-
"mcp[cli]",
|
|
128
|
+
"mcp[cli]>=1.22,<2",
|
|
125
129
|
]
|
|
126
130
|
|
|
127
131
|
# Audio recording and transcription (requires external libraries)
|
|
@@ -140,7 +144,6 @@ all = [
|
|
|
140
144
|
"langchain_anthropic",
|
|
141
145
|
"mistune",
|
|
142
146
|
"htmldocx",
|
|
143
|
-
"docx",
|
|
144
147
|
"md2pdf",
|
|
145
148
|
"pypandoc",
|
|
146
149
|
"streamlit",
|
|
@@ -150,7 +153,7 @@ all = [
|
|
|
150
153
|
"backoff",
|
|
151
154
|
"pyperclip",
|
|
152
155
|
"pillow_heif",
|
|
153
|
-
"mcp[cli]",
|
|
156
|
+
"mcp[cli]>=1.22,<2",
|
|
154
157
|
"pyaudio",
|
|
155
158
|
"SpeechRecognition",
|
|
156
159
|
]
|
|
@@ -201,4 +204,10 @@ exclude_lines = [
|
|
|
201
204
|
directory = "htmlcov"
|
|
202
205
|
|
|
203
206
|
# (shell-command "uv build")
|
|
204
|
-
# (shell-command "uv publish")
|
|
207
|
+
# (shell-command "uv publish")
|
|
208
|
+
[tool.ruff.lint.per-file-ignores]
|
|
209
|
+
# The Streamlit UI and the MCP tools are top-level boundaries: any error is
|
|
210
|
+
# shown to the user (st.error / tool result) instead of crashing the page or
|
|
211
|
+
# server, and optional metadata parsing falls back silently.
|
|
212
|
+
"src/litdb/app.py" = ["BLE001", "S110"]
|
|
213
|
+
"src/litdb/mcp_server.py" = ["BLE001"]
|