iflow-mcp-yuzongmin-sqlite-literature-management-fastmcp-mcp-server 0.1.3__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.
- iflow_mcp_yuzongmin_sqlite_literature_management_fastmcp_mcp_server-0.1.3.data/data/share/source_manager_pkg/LICENSE +21 -0
- iflow_mcp_yuzongmin_sqlite_literature_management_fastmcp_mcp_server-0.1.3.data/data/share/source_manager_pkg/README.md +191 -0
- iflow_mcp_yuzongmin_sqlite_literature_management_fastmcp_mcp_server-0.1.3.data/data/share/source_manager_pkg/create_sources_db.sql +32 -0
- iflow_mcp_yuzongmin_sqlite_literature_management_fastmcp_mcp_server-0.1.3.dist-info/METADATA +199 -0
- iflow_mcp_yuzongmin_sqlite_literature_management_fastmcp_mcp_server-0.1.3.dist-info/RECORD +14 -0
- iflow_mcp_yuzongmin_sqlite_literature_management_fastmcp_mcp_server-0.1.3.dist-info/WHEEL +4 -0
- iflow_mcp_yuzongmin_sqlite_literature_management_fastmcp_mcp_server-0.1.3.dist-info/entry_points.txt +2 -0
- source_manager_pkg/LICENSE +21 -0
- source_manager_pkg/README.md +191 -0
- source_manager_pkg/TODO.md +0 -0
- source_manager_pkg/__init__.py +1628 -0
- source_manager_pkg/create_sources_db.sql +32 -0
- source_manager_pkg/memory.jsonl +0 -0
- source_manager_pkg/sources.db +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Zongmin Yu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Universal Source Management System
|
|
2
|
+
|
|
3
|
+
A flexible system for managing various types of sources (papers, books, webpages, etc.) and integrating them with knowledge graphs.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
### Core Features
|
|
8
|
+
|
|
9
|
+
- Universal source identification with internal UUID system
|
|
10
|
+
- Support for multiple source types (papers, webpages, books, videos, blogs)
|
|
11
|
+
- Multiple identifier support per source (arxiv, DOI, semantic scholar, ISBN, URL)
|
|
12
|
+
- Structured note-taking with titles and content
|
|
13
|
+
- Status tracking (unread, reading, completed, archived)
|
|
14
|
+
|
|
15
|
+
### Entity Integration
|
|
16
|
+
|
|
17
|
+
- Link sources to knowledge graph entities
|
|
18
|
+
- Track relationships between sources and entities
|
|
19
|
+
- Flexible relation types (discusses, introduces, extends, etc.)
|
|
20
|
+
- Integration with memory graph
|
|
21
|
+
|
|
22
|
+
## Prerequisites
|
|
23
|
+
|
|
24
|
+
This system integrates with the [MCP Memory Server](https://github.com/modelcontextprotocol/servers/tree/main/src/memory) for persistent knowledge graph storage.
|
|
25
|
+
|
|
26
|
+
## Quick Start
|
|
27
|
+
|
|
28
|
+
1. Create a new SQLite database with our schema:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Create a new database
|
|
32
|
+
sqlite3 sources.db < create_sources_db.sql
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
2. Install the source management server:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Install for Claude Desktop with your database path
|
|
39
|
+
fastmcp install source-manager-server.py --name "Source Manager" -e SQLITE_DB_PATH=/path/to/sources.db
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Schema
|
|
43
|
+
|
|
44
|
+
### Core Tables
|
|
45
|
+
|
|
46
|
+
```sql
|
|
47
|
+
-- Sources table
|
|
48
|
+
CREATE TABLE sources (
|
|
49
|
+
id UUID PRIMARY KEY,
|
|
50
|
+
title TEXT NOT NULL,
|
|
51
|
+
type TEXT CHECK(type IN ('paper', 'webpage', 'book', 'video', 'blog')) NOT NULL,
|
|
52
|
+
identifiers JSONB NOT NULL,
|
|
53
|
+
status TEXT CHECK(status IN ('unread', 'reading', 'completed', 'archived')) DEFAULT 'unread'
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
-- Source notes
|
|
57
|
+
CREATE TABLE source_notes (
|
|
58
|
+
source_id UUID REFERENCES sources(id),
|
|
59
|
+
note_title TEXT NOT NULL,
|
|
60
|
+
content TEXT NOT NULL,
|
|
61
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
62
|
+
PRIMARY KEY (source_id, note_title)
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
-- Entity links
|
|
66
|
+
CREATE TABLE source_entity_links (
|
|
67
|
+
source_id UUID REFERENCES sources(id),
|
|
68
|
+
entity_name TEXT,
|
|
69
|
+
relation_type TEXT CHECK(relation_type IN ('discusses', 'introduces', 'extends', 'evaluates', 'applies', 'critiques')),
|
|
70
|
+
notes TEXT,
|
|
71
|
+
PRIMARY KEY (source_id, entity_name)
|
|
72
|
+
);
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Usage Examples
|
|
76
|
+
|
|
77
|
+
### 1. Managing Sources
|
|
78
|
+
|
|
79
|
+
Add a paper with multiple identifiers:
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
add_source(
|
|
83
|
+
title="Attention Is All You Need",
|
|
84
|
+
type="paper",
|
|
85
|
+
identifier_type="arxiv",
|
|
86
|
+
identifier_value="1706.03762",
|
|
87
|
+
initial_note={
|
|
88
|
+
"title": "Initial thoughts",
|
|
89
|
+
"content": "Groundbreaking paper introducing transformers..."
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
# Add another identifier to the same paper
|
|
94
|
+
add_identifier(
|
|
95
|
+
title="Attention Is All You Need",
|
|
96
|
+
type="paper",
|
|
97
|
+
current_identifier_type="arxiv",
|
|
98
|
+
current_identifier_value="1706.03762",
|
|
99
|
+
new_identifier_type="semantic_scholar",
|
|
100
|
+
new_identifier_value="204e3073870fae3d05bcbc2f6a8e263d9b72e776"
|
|
101
|
+
)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Add a webpage:
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
add_source(
|
|
108
|
+
title="Understanding Transformers",
|
|
109
|
+
type="webpage",
|
|
110
|
+
identifier_type="url",
|
|
111
|
+
identifier_value="https://example.com/transformers",
|
|
112
|
+
)
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 2. Note Taking
|
|
116
|
+
|
|
117
|
+
Add notes to a source:
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
add_note(
|
|
121
|
+
title="Attention Is All You Need",
|
|
122
|
+
type="paper",
|
|
123
|
+
identifier_type="arxiv",
|
|
124
|
+
identifier_value="1706.03762",
|
|
125
|
+
note_title="Implementation details",
|
|
126
|
+
note_content="The paper describes the architecture..."
|
|
127
|
+
)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 3. Entity Linking
|
|
131
|
+
|
|
132
|
+
Link source to entities:
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
link_to_entity(
|
|
136
|
+
title="Attention Is All You Need",
|
|
137
|
+
type="paper",
|
|
138
|
+
identifier_type="arxiv",
|
|
139
|
+
identifier_value="1706.03762",
|
|
140
|
+
entity_name="transformer",
|
|
141
|
+
relation_type="introduces",
|
|
142
|
+
notes="First paper to introduce the transformer architecture"
|
|
143
|
+
)
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Query sources by entity:
|
|
147
|
+
|
|
148
|
+
```python
|
|
149
|
+
get_entity_sources(
|
|
150
|
+
entity_name="transformer",
|
|
151
|
+
type_filter="paper",
|
|
152
|
+
relation_filter="discusses"
|
|
153
|
+
)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Best Practices
|
|
157
|
+
|
|
158
|
+
1. Source Management
|
|
159
|
+
|
|
160
|
+
- Use consistent titles across references
|
|
161
|
+
- Provide as many identifiers as available
|
|
162
|
+
- Keep notes structured with clear titles
|
|
163
|
+
- Use appropriate source types
|
|
164
|
+
|
|
165
|
+
2. Entity Linking
|
|
166
|
+
- Be specific with relation types
|
|
167
|
+
- Add contextual notes to relationships
|
|
168
|
+
- Verify entity names against memory graph
|
|
169
|
+
- Keep entity relationships focused
|
|
170
|
+
|
|
171
|
+
## Technical Details
|
|
172
|
+
|
|
173
|
+
1. Source Identification
|
|
174
|
+
|
|
175
|
+
- Internal UUID system for consistent referencing
|
|
176
|
+
- Multiple external identifiers per source
|
|
177
|
+
- Flexible identifier types (arxiv, doi, url, etc.)
|
|
178
|
+
- Title and type based fuzzy matching
|
|
179
|
+
|
|
180
|
+
2. Data Organization
|
|
181
|
+
- Structured notes with titles
|
|
182
|
+
- Clear source type categorization
|
|
183
|
+
- Entity relationship tracking
|
|
184
|
+
- Status management
|
|
185
|
+
|
|
186
|
+
## Contributing
|
|
187
|
+
|
|
188
|
+
1. Fork the repository
|
|
189
|
+
2. Create a feature branch
|
|
190
|
+
3. Add tests for new features
|
|
191
|
+
4. Submit a pull request
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
-- Core sources table
|
|
2
|
+
CREATE TABLE sources (
|
|
3
|
+
id TEXT PRIMARY KEY, -- Using TEXT for UUID storage
|
|
4
|
+
title TEXT NOT NULL,
|
|
5
|
+
type TEXT CHECK(type IN ('paper', 'webpage', 'book', 'video', 'blog')) NOT NULL,
|
|
6
|
+
identifiers TEXT NOT NULL, -- JSON string storing {type: value} pairs
|
|
7
|
+
status TEXT CHECK(status IN ('unread', 'reading', 'completed', 'archived')) DEFAULT 'unread'
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
-- Notes with titles for better organization
|
|
11
|
+
CREATE TABLE source_notes (
|
|
12
|
+
source_id TEXT REFERENCES sources(id),
|
|
13
|
+
note_title TEXT NOT NULL,
|
|
14
|
+
content TEXT NOT NULL,
|
|
15
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
16
|
+
PRIMARY KEY (source_id, note_title)
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
-- Entity links remain essential for knowledge graph integration
|
|
20
|
+
CREATE TABLE source_entity_links (
|
|
21
|
+
source_id TEXT REFERENCES sources(id),
|
|
22
|
+
entity_name TEXT,
|
|
23
|
+
relation_type TEXT CHECK(relation_type IN ('discusses', 'introduces', 'extends', 'evaluates', 'applies', 'critiques')),
|
|
24
|
+
notes TEXT,
|
|
25
|
+
PRIMARY KEY (source_id, entity_name)
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
-- Create indexes for better performance
|
|
29
|
+
CREATE INDEX idx_sources_type ON sources(type);
|
|
30
|
+
CREATE INDEX idx_sources_status ON sources(status);
|
|
31
|
+
CREATE INDEX idx_source_notes_created ON source_notes(created_at);
|
|
32
|
+
CREATE INDEX idx_entity_links_name ON source_entity_links(entity_name);
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: iflow-mcp-yuzongmin-sqlite-literature-management-fastmcp-mcp-server
|
|
3
|
+
Version: 0.1.3
|
|
4
|
+
Summary: A flexible system for managing various types of sources (papers, books, webpages, etc.) and integrating them with knowledge graphs
|
|
5
|
+
Requires-Python: >=3.8
|
|
6
|
+
Requires-Dist: fastmcp>=0.1.0
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
|
|
9
|
+
# Universal Source Management System
|
|
10
|
+
|
|
11
|
+
A flexible system for managing various types of sources (papers, books, webpages, etc.) and integrating them with knowledge graphs.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
### Core Features
|
|
16
|
+
|
|
17
|
+
- Universal source identification with internal UUID system
|
|
18
|
+
- Support for multiple source types (papers, webpages, books, videos, blogs)
|
|
19
|
+
- Multiple identifier support per source (arxiv, DOI, semantic scholar, ISBN, URL)
|
|
20
|
+
- Structured note-taking with titles and content
|
|
21
|
+
- Status tracking (unread, reading, completed, archived)
|
|
22
|
+
|
|
23
|
+
### Entity Integration
|
|
24
|
+
|
|
25
|
+
- Link sources to knowledge graph entities
|
|
26
|
+
- Track relationships between sources and entities
|
|
27
|
+
- Flexible relation types (discusses, introduces, extends, etc.)
|
|
28
|
+
- Integration with memory graph
|
|
29
|
+
|
|
30
|
+
## Prerequisites
|
|
31
|
+
|
|
32
|
+
This system integrates with the [MCP Memory Server](https://github.com/modelcontextprotocol/servers/tree/main/src/memory) for persistent knowledge graph storage.
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
1. Create a new SQLite database with our schema:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Create a new database
|
|
40
|
+
sqlite3 sources.db < create_sources_db.sql
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
2. Install the source management server:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Install for Claude Desktop with your database path
|
|
47
|
+
fastmcp install source-manager-server.py --name "Source Manager" -e SQLITE_DB_PATH=/path/to/sources.db
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Schema
|
|
51
|
+
|
|
52
|
+
### Core Tables
|
|
53
|
+
|
|
54
|
+
```sql
|
|
55
|
+
-- Sources table
|
|
56
|
+
CREATE TABLE sources (
|
|
57
|
+
id UUID PRIMARY KEY,
|
|
58
|
+
title TEXT NOT NULL,
|
|
59
|
+
type TEXT CHECK(type IN ('paper', 'webpage', 'book', 'video', 'blog')) NOT NULL,
|
|
60
|
+
identifiers JSONB NOT NULL,
|
|
61
|
+
status TEXT CHECK(status IN ('unread', 'reading', 'completed', 'archived')) DEFAULT 'unread'
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
-- Source notes
|
|
65
|
+
CREATE TABLE source_notes (
|
|
66
|
+
source_id UUID REFERENCES sources(id),
|
|
67
|
+
note_title TEXT NOT NULL,
|
|
68
|
+
content TEXT NOT NULL,
|
|
69
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
70
|
+
PRIMARY KEY (source_id, note_title)
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
-- Entity links
|
|
74
|
+
CREATE TABLE source_entity_links (
|
|
75
|
+
source_id UUID REFERENCES sources(id),
|
|
76
|
+
entity_name TEXT,
|
|
77
|
+
relation_type TEXT CHECK(relation_type IN ('discusses', 'introduces', 'extends', 'evaluates', 'applies', 'critiques')),
|
|
78
|
+
notes TEXT,
|
|
79
|
+
PRIMARY KEY (source_id, entity_name)
|
|
80
|
+
);
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Usage Examples
|
|
84
|
+
|
|
85
|
+
### 1. Managing Sources
|
|
86
|
+
|
|
87
|
+
Add a paper with multiple identifiers:
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
add_source(
|
|
91
|
+
title="Attention Is All You Need",
|
|
92
|
+
type="paper",
|
|
93
|
+
identifier_type="arxiv",
|
|
94
|
+
identifier_value="1706.03762",
|
|
95
|
+
initial_note={
|
|
96
|
+
"title": "Initial thoughts",
|
|
97
|
+
"content": "Groundbreaking paper introducing transformers..."
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
# Add another identifier to the same paper
|
|
102
|
+
add_identifier(
|
|
103
|
+
title="Attention Is All You Need",
|
|
104
|
+
type="paper",
|
|
105
|
+
current_identifier_type="arxiv",
|
|
106
|
+
current_identifier_value="1706.03762",
|
|
107
|
+
new_identifier_type="semantic_scholar",
|
|
108
|
+
new_identifier_value="204e3073870fae3d05bcbc2f6a8e263d9b72e776"
|
|
109
|
+
)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Add a webpage:
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
add_source(
|
|
116
|
+
title="Understanding Transformers",
|
|
117
|
+
type="webpage",
|
|
118
|
+
identifier_type="url",
|
|
119
|
+
identifier_value="https://example.com/transformers",
|
|
120
|
+
)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### 2. Note Taking
|
|
124
|
+
|
|
125
|
+
Add notes to a source:
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
add_note(
|
|
129
|
+
title="Attention Is All You Need",
|
|
130
|
+
type="paper",
|
|
131
|
+
identifier_type="arxiv",
|
|
132
|
+
identifier_value="1706.03762",
|
|
133
|
+
note_title="Implementation details",
|
|
134
|
+
note_content="The paper describes the architecture..."
|
|
135
|
+
)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### 3. Entity Linking
|
|
139
|
+
|
|
140
|
+
Link source to entities:
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
link_to_entity(
|
|
144
|
+
title="Attention Is All You Need",
|
|
145
|
+
type="paper",
|
|
146
|
+
identifier_type="arxiv",
|
|
147
|
+
identifier_value="1706.03762",
|
|
148
|
+
entity_name="transformer",
|
|
149
|
+
relation_type="introduces",
|
|
150
|
+
notes="First paper to introduce the transformer architecture"
|
|
151
|
+
)
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Query sources by entity:
|
|
155
|
+
|
|
156
|
+
```python
|
|
157
|
+
get_entity_sources(
|
|
158
|
+
entity_name="transformer",
|
|
159
|
+
type_filter="paper",
|
|
160
|
+
relation_filter="discusses"
|
|
161
|
+
)
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Best Practices
|
|
165
|
+
|
|
166
|
+
1. Source Management
|
|
167
|
+
|
|
168
|
+
- Use consistent titles across references
|
|
169
|
+
- Provide as many identifiers as available
|
|
170
|
+
- Keep notes structured with clear titles
|
|
171
|
+
- Use appropriate source types
|
|
172
|
+
|
|
173
|
+
2. Entity Linking
|
|
174
|
+
- Be specific with relation types
|
|
175
|
+
- Add contextual notes to relationships
|
|
176
|
+
- Verify entity names against memory graph
|
|
177
|
+
- Keep entity relationships focused
|
|
178
|
+
|
|
179
|
+
## Technical Details
|
|
180
|
+
|
|
181
|
+
1. Source Identification
|
|
182
|
+
|
|
183
|
+
- Internal UUID system for consistent referencing
|
|
184
|
+
- Multiple external identifiers per source
|
|
185
|
+
- Flexible identifier types (arxiv, doi, url, etc.)
|
|
186
|
+
- Title and type based fuzzy matching
|
|
187
|
+
|
|
188
|
+
2. Data Organization
|
|
189
|
+
- Structured notes with titles
|
|
190
|
+
- Clear source type categorization
|
|
191
|
+
- Entity relationship tracking
|
|
192
|
+
- Status management
|
|
193
|
+
|
|
194
|
+
## Contributing
|
|
195
|
+
|
|
196
|
+
1. Fork the repository
|
|
197
|
+
2. Create a feature branch
|
|
198
|
+
3. Add tests for new features
|
|
199
|
+
4. Submit a pull request
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
source_manager_pkg/LICENSE,sha256=3Yjua4f62AxnTsuGEUl2EgieD9gLOXYYtfRyXWyJcbU,1067
|
|
2
|
+
source_manager_pkg/README.md,sha256=463R3S4KNgooiWZ7FUvwYeYQ_uyrfhjOJLQaVq52jfc,4726
|
|
3
|
+
source_manager_pkg/TODO.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
source_manager_pkg/__init__.py,sha256=xRHtuRyhbl8E-fYWo1aIdYBR02wcWjtcOMGLW99e91I,59757
|
|
5
|
+
source_manager_pkg/create_sources_db.sql,sha256=1t_-3KLsAr4yh6iR1tB0rjR1tKygv-zcSgRKIj6Ox4w,1286
|
|
6
|
+
source_manager_pkg/memory.jsonl,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
source_manager_pkg/sources.db,sha256=xfjg-kX8IWql-0OTYM5eLCgIb2jPkSjSUTBhpKFm8Y4,45056
|
|
8
|
+
iflow_mcp_yuzongmin_sqlite_literature_management_fastmcp_mcp_server-0.1.3.data/data/share/source_manager_pkg/LICENSE,sha256=3Yjua4f62AxnTsuGEUl2EgieD9gLOXYYtfRyXWyJcbU,1067
|
|
9
|
+
iflow_mcp_yuzongmin_sqlite_literature_management_fastmcp_mcp_server-0.1.3.data/data/share/source_manager_pkg/README.md,sha256=463R3S4KNgooiWZ7FUvwYeYQ_uyrfhjOJLQaVq52jfc,4726
|
|
10
|
+
iflow_mcp_yuzongmin_sqlite_literature_management_fastmcp_mcp_server-0.1.3.data/data/share/source_manager_pkg/create_sources_db.sql,sha256=1t_-3KLsAr4yh6iR1tB0rjR1tKygv-zcSgRKIj6Ox4w,1286
|
|
11
|
+
iflow_mcp_yuzongmin_sqlite_literature_management_fastmcp_mcp_server-0.1.3.dist-info/METADATA,sha256=xgDfnIvQfe6z6tOoZl8BDWEkEF0I2cA5u2gbsof8L5I,5071
|
|
12
|
+
iflow_mcp_yuzongmin_sqlite_literature_management_fastmcp_mcp_server-0.1.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
13
|
+
iflow_mcp_yuzongmin_sqlite_literature_management_fastmcp_mcp_server-0.1.3.dist-info/entry_points.txt,sha256=GwZUtV8IrSYWlS2SLv8TfXCVzNaKGS4nE0aZKWAmrqg,59
|
|
14
|
+
iflow_mcp_yuzongmin_sqlite_literature_management_fastmcp_mcp_server-0.1.3.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Zongmin Yu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Universal Source Management System
|
|
2
|
+
|
|
3
|
+
A flexible system for managing various types of sources (papers, books, webpages, etc.) and integrating them with knowledge graphs.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
### Core Features
|
|
8
|
+
|
|
9
|
+
- Universal source identification with internal UUID system
|
|
10
|
+
- Support for multiple source types (papers, webpages, books, videos, blogs)
|
|
11
|
+
- Multiple identifier support per source (arxiv, DOI, semantic scholar, ISBN, URL)
|
|
12
|
+
- Structured note-taking with titles and content
|
|
13
|
+
- Status tracking (unread, reading, completed, archived)
|
|
14
|
+
|
|
15
|
+
### Entity Integration
|
|
16
|
+
|
|
17
|
+
- Link sources to knowledge graph entities
|
|
18
|
+
- Track relationships between sources and entities
|
|
19
|
+
- Flexible relation types (discusses, introduces, extends, etc.)
|
|
20
|
+
- Integration with memory graph
|
|
21
|
+
|
|
22
|
+
## Prerequisites
|
|
23
|
+
|
|
24
|
+
This system integrates with the [MCP Memory Server](https://github.com/modelcontextprotocol/servers/tree/main/src/memory) for persistent knowledge graph storage.
|
|
25
|
+
|
|
26
|
+
## Quick Start
|
|
27
|
+
|
|
28
|
+
1. Create a new SQLite database with our schema:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Create a new database
|
|
32
|
+
sqlite3 sources.db < create_sources_db.sql
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
2. Install the source management server:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# Install for Claude Desktop with your database path
|
|
39
|
+
fastmcp install source-manager-server.py --name "Source Manager" -e SQLITE_DB_PATH=/path/to/sources.db
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Schema
|
|
43
|
+
|
|
44
|
+
### Core Tables
|
|
45
|
+
|
|
46
|
+
```sql
|
|
47
|
+
-- Sources table
|
|
48
|
+
CREATE TABLE sources (
|
|
49
|
+
id UUID PRIMARY KEY,
|
|
50
|
+
title TEXT NOT NULL,
|
|
51
|
+
type TEXT CHECK(type IN ('paper', 'webpage', 'book', 'video', 'blog')) NOT NULL,
|
|
52
|
+
identifiers JSONB NOT NULL,
|
|
53
|
+
status TEXT CHECK(status IN ('unread', 'reading', 'completed', 'archived')) DEFAULT 'unread'
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
-- Source notes
|
|
57
|
+
CREATE TABLE source_notes (
|
|
58
|
+
source_id UUID REFERENCES sources(id),
|
|
59
|
+
note_title TEXT NOT NULL,
|
|
60
|
+
content TEXT NOT NULL,
|
|
61
|
+
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
62
|
+
PRIMARY KEY (source_id, note_title)
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
-- Entity links
|
|
66
|
+
CREATE TABLE source_entity_links (
|
|
67
|
+
source_id UUID REFERENCES sources(id),
|
|
68
|
+
entity_name TEXT,
|
|
69
|
+
relation_type TEXT CHECK(relation_type IN ('discusses', 'introduces', 'extends', 'evaluates', 'applies', 'critiques')),
|
|
70
|
+
notes TEXT,
|
|
71
|
+
PRIMARY KEY (source_id, entity_name)
|
|
72
|
+
);
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Usage Examples
|
|
76
|
+
|
|
77
|
+
### 1. Managing Sources
|
|
78
|
+
|
|
79
|
+
Add a paper with multiple identifiers:
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
add_source(
|
|
83
|
+
title="Attention Is All You Need",
|
|
84
|
+
type="paper",
|
|
85
|
+
identifier_type="arxiv",
|
|
86
|
+
identifier_value="1706.03762",
|
|
87
|
+
initial_note={
|
|
88
|
+
"title": "Initial thoughts",
|
|
89
|
+
"content": "Groundbreaking paper introducing transformers..."
|
|
90
|
+
}
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
# Add another identifier to the same paper
|
|
94
|
+
add_identifier(
|
|
95
|
+
title="Attention Is All You Need",
|
|
96
|
+
type="paper",
|
|
97
|
+
current_identifier_type="arxiv",
|
|
98
|
+
current_identifier_value="1706.03762",
|
|
99
|
+
new_identifier_type="semantic_scholar",
|
|
100
|
+
new_identifier_value="204e3073870fae3d05bcbc2f6a8e263d9b72e776"
|
|
101
|
+
)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Add a webpage:
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
add_source(
|
|
108
|
+
title="Understanding Transformers",
|
|
109
|
+
type="webpage",
|
|
110
|
+
identifier_type="url",
|
|
111
|
+
identifier_value="https://example.com/transformers",
|
|
112
|
+
)
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 2. Note Taking
|
|
116
|
+
|
|
117
|
+
Add notes to a source:
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
add_note(
|
|
121
|
+
title="Attention Is All You Need",
|
|
122
|
+
type="paper",
|
|
123
|
+
identifier_type="arxiv",
|
|
124
|
+
identifier_value="1706.03762",
|
|
125
|
+
note_title="Implementation details",
|
|
126
|
+
note_content="The paper describes the architecture..."
|
|
127
|
+
)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### 3. Entity Linking
|
|
131
|
+
|
|
132
|
+
Link source to entities:
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
link_to_entity(
|
|
136
|
+
title="Attention Is All You Need",
|
|
137
|
+
type="paper",
|
|
138
|
+
identifier_type="arxiv",
|
|
139
|
+
identifier_value="1706.03762",
|
|
140
|
+
entity_name="transformer",
|
|
141
|
+
relation_type="introduces",
|
|
142
|
+
notes="First paper to introduce the transformer architecture"
|
|
143
|
+
)
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Query sources by entity:
|
|
147
|
+
|
|
148
|
+
```python
|
|
149
|
+
get_entity_sources(
|
|
150
|
+
entity_name="transformer",
|
|
151
|
+
type_filter="paper",
|
|
152
|
+
relation_filter="discusses"
|
|
153
|
+
)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Best Practices
|
|
157
|
+
|
|
158
|
+
1. Source Management
|
|
159
|
+
|
|
160
|
+
- Use consistent titles across references
|
|
161
|
+
- Provide as many identifiers as available
|
|
162
|
+
- Keep notes structured with clear titles
|
|
163
|
+
- Use appropriate source types
|
|
164
|
+
|
|
165
|
+
2. Entity Linking
|
|
166
|
+
- Be specific with relation types
|
|
167
|
+
- Add contextual notes to relationships
|
|
168
|
+
- Verify entity names against memory graph
|
|
169
|
+
- Keep entity relationships focused
|
|
170
|
+
|
|
171
|
+
## Technical Details
|
|
172
|
+
|
|
173
|
+
1. Source Identification
|
|
174
|
+
|
|
175
|
+
- Internal UUID system for consistent referencing
|
|
176
|
+
- Multiple external identifiers per source
|
|
177
|
+
- Flexible identifier types (arxiv, doi, url, etc.)
|
|
178
|
+
- Title and type based fuzzy matching
|
|
179
|
+
|
|
180
|
+
2. Data Organization
|
|
181
|
+
- Structured notes with titles
|
|
182
|
+
- Clear source type categorization
|
|
183
|
+
- Entity relationship tracking
|
|
184
|
+
- Status management
|
|
185
|
+
|
|
186
|
+
## Contributing
|
|
187
|
+
|
|
188
|
+
1. Fork the repository
|
|
189
|
+
2. Create a feature branch
|
|
190
|
+
3. Add tests for new features
|
|
191
|
+
4. Submit a pull request
|
|
File without changes
|