mcp-sqlite-memory-bank 1.1.0__tar.gz → 1.2.0__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.
Files changed (19) hide show
  1. {mcp_sqlite_memory_bank-1.1.0/src/mcp_sqlite_memory_bank.egg-info → mcp_sqlite_memory_bank-1.2.0}/PKG-INFO +25 -26
  2. {mcp_sqlite_memory_bank-1.1.0 → mcp_sqlite_memory_bank-1.2.0}/README.md +24 -25
  3. {mcp_sqlite_memory_bank-1.1.0 → mcp_sqlite_memory_bank-1.2.0}/pyproject.toml +4 -1
  4. {mcp_sqlite_memory_bank-1.1.0 → mcp_sqlite_memory_bank-1.2.0}/src/mcp_sqlite_memory_bank/server.py +60 -41
  5. {mcp_sqlite_memory_bank-1.1.0 → mcp_sqlite_memory_bank-1.2.0/src/mcp_sqlite_memory_bank.egg-info}/PKG-INFO +25 -26
  6. {mcp_sqlite_memory_bank-1.1.0 → mcp_sqlite_memory_bank-1.2.0}/src/mcp_sqlite_memory_bank.egg-info/SOURCES.txt +1 -0
  7. mcp_sqlite_memory_bank-1.2.0/src/mcp_sqlite_memory_bank.egg-info/entry_points.txt +2 -0
  8. {mcp_sqlite_memory_bank-1.1.0 → mcp_sqlite_memory_bank-1.2.0}/LICENSE +0 -0
  9. {mcp_sqlite_memory_bank-1.1.0 → mcp_sqlite_memory_bank-1.2.0}/MANIFEST.in +0 -0
  10. {mcp_sqlite_memory_bank-1.1.0 → mcp_sqlite_memory_bank-1.2.0}/setup.cfg +0 -0
  11. {mcp_sqlite_memory_bank-1.1.0 → mcp_sqlite_memory_bank-1.2.0}/src/mcp_sqlite_memory_bank/__init__.py +0 -0
  12. {mcp_sqlite_memory_bank-1.1.0 → mcp_sqlite_memory_bank-1.2.0}/src/mcp_sqlite_memory_bank/py.typed +0 -0
  13. {mcp_sqlite_memory_bank-1.1.0 → mcp_sqlite_memory_bank-1.2.0}/src/mcp_sqlite_memory_bank/types.py +0 -0
  14. {mcp_sqlite_memory_bank-1.1.0 → mcp_sqlite_memory_bank-1.2.0}/src/mcp_sqlite_memory_bank/utils.py +0 -0
  15. {mcp_sqlite_memory_bank-1.1.0 → mcp_sqlite_memory_bank-1.2.0}/src/mcp_sqlite_memory_bank.egg-info/dependency_links.txt +0 -0
  16. {mcp_sqlite_memory_bank-1.1.0 → mcp_sqlite_memory_bank-1.2.0}/src/mcp_sqlite_memory_bank.egg-info/requires.txt +0 -0
  17. {mcp_sqlite_memory_bank-1.1.0 → mcp_sqlite_memory_bank-1.2.0}/src/mcp_sqlite_memory_bank.egg-info/top_level.txt +0 -0
  18. {mcp_sqlite_memory_bank-1.1.0 → mcp_sqlite_memory_bank-1.2.0}/tests/test_api.py +0 -0
  19. {mcp_sqlite_memory_bank-1.1.0 → mcp_sqlite_memory_bank-1.2.0}/tests/test_server.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp_sqlite_memory_bank
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: A dynamic, agent/LLM-friendly SQLite memory bank for MCP servers.
5
5
  Author-email: Robert Meisner <robert@catchit.pl>
6
6
  License-Expression: MIT
@@ -19,30 +19,6 @@ Provides-Extra: test
19
19
  Requires-Dist: pytest; extra == "test"
20
20
  Dynamic: license-file
21
21
 
22
- ## Development Setup
23
-
24
- To ensure code quality and consistent style, this project uses `flake8` and `pre-commit` hooks.
25
-
26
- **Install development dependencies:**
27
-
28
- ```sh
29
- pip install -r requirements.txt
30
- ```
31
-
32
- **Enable pre-commit hooks (recommended):**
33
-
34
- ```sh
35
- pre-commit install
36
- ```
37
-
38
- This will automatically run `flake8` on staged files before every commit. To manually check all files:
39
-
40
- ```sh
41
- pre-commit run --all-files
42
- ```
43
-
44
- If you see lint errors, fix them before committing. You can configure linting rules in the `.flake8` file.
45
-
46
22
  # mcp_sqlite_memory_bank
47
23
 
48
24
  ![PyPI](https://img.shields.io/pypi/v/mcp_sqlite_memory_bank)
@@ -143,7 +119,7 @@ curl -fsSL https://uvx.zip/install.sh | bash
143
119
  uvx run mcp_sqlite_memory_bank
144
120
 
145
121
  # Or, specify a version
146
- uvx run mcp_sqlite_memory_bank@1.0.0
122
+ uvx run mcp_sqlite_memory_bank@latest
147
123
  ```
148
124
 
149
125
  ### Option 5: Docker (Containerized) # Coming soon - not yet implemented
@@ -447,6 +423,29 @@ pytest --import-mode=importlib
447
423
 
448
424
  ---
449
425
 
426
+ ## Development Setup
427
+
428
+ To ensure code quality and consistent style, this project uses `flake8` and `pre-commit` hooks.
429
+
430
+ **Install development dependencies:**
431
+
432
+ ```sh
433
+ pip install -r requirements.txt
434
+ ```
435
+
436
+ **Enable pre-commit hooks (recommended):**
437
+
438
+ ```sh
439
+ pre-commit install
440
+ ```
441
+
442
+ This will automatically run `flake8` on staged files before every commit. To manually check all files:
443
+
444
+ ```sh
445
+ pre-commit run --all-files
446
+ ```
447
+
448
+ If you see lint errors, fix them before committing. You can configure linting rules in the `.flake8` file.
450
449
 
451
450
  ## Support & Contact
452
451
 
@@ -1,27 +1,3 @@
1
- ## Development Setup
2
-
3
- To ensure code quality and consistent style, this project uses `flake8` and `pre-commit` hooks.
4
-
5
- **Install development dependencies:**
6
-
7
- ```sh
8
- pip install -r requirements.txt
9
- ```
10
-
11
- **Enable pre-commit hooks (recommended):**
12
-
13
- ```sh
14
- pre-commit install
15
- ```
16
-
17
- This will automatically run `flake8` on staged files before every commit. To manually check all files:
18
-
19
- ```sh
20
- pre-commit run --all-files
21
- ```
22
-
23
- If you see lint errors, fix them before committing. You can configure linting rules in the `.flake8` file.
24
-
25
1
  # mcp_sqlite_memory_bank
26
2
 
27
3
  ![PyPI](https://img.shields.io/pypi/v/mcp_sqlite_memory_bank)
@@ -122,7 +98,7 @@ curl -fsSL https://uvx.zip/install.sh | bash
122
98
  uvx run mcp_sqlite_memory_bank
123
99
 
124
100
  # Or, specify a version
125
- uvx run mcp_sqlite_memory_bank@1.0.0
101
+ uvx run mcp_sqlite_memory_bank@latest
126
102
  ```
127
103
 
128
104
  ### Option 5: Docker (Containerized) # Coming soon - not yet implemented
@@ -426,6 +402,29 @@ pytest --import-mode=importlib
426
402
 
427
403
  ---
428
404
 
405
+ ## Development Setup
406
+
407
+ To ensure code quality and consistent style, this project uses `flake8` and `pre-commit` hooks.
408
+
409
+ **Install development dependencies:**
410
+
411
+ ```sh
412
+ pip install -r requirements.txt
413
+ ```
414
+
415
+ **Enable pre-commit hooks (recommended):**
416
+
417
+ ```sh
418
+ pre-commit install
419
+ ```
420
+
421
+ This will automatically run `flake8` on staged files before every commit. To manually check all files:
422
+
423
+ ```sh
424
+ pre-commit run --all-files
425
+ ```
426
+
427
+ If you see lint errors, fix them before committing. You can configure linting rules in the `.flake8` file.
429
428
 
430
429
  ## Support & Contact
431
430
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "mcp_sqlite_memory_bank"
7
- version = "1.1.0"
7
+ version = "1.2.0"
8
8
  description = "A dynamic, agent/LLM-friendly SQLite memory bank for MCP servers."
9
9
  authors = [
10
10
  { name="Robert Meisner", email="robert@catchit.pl" }
@@ -23,6 +23,9 @@ dependencies = [
23
23
  "pydantic>=1.10.0"
24
24
  ]
25
25
 
26
+ [project.scripts]
27
+ mcp-sqlite-memory-bank = "mcp_sqlite_memory_bank.server:main"
28
+
26
29
  [project.urls]
27
30
  Homepage = "https://github.com/robertmeisner/mcp_sqlite_memory_bank"
28
31
  Source = "https://github.com/robertmeisner/mcp_sqlite_memory_bank"
@@ -840,7 +840,8 @@ def _create_row_impl(table_name: str, data: Dict[str, Any]) -> Dict[str, Any]:
840
840
  with sqlite3.connect(DB_PATH) as conn:
841
841
  cur = conn.cursor()
842
842
  cur.execute(
843
- "SELECT name FROM sqlite_master WHERE type='table' AND name=?", (table_name,))
843
+ "SELECT name FROM sqlite_master WHERE type='table' AND name=?", (table_name,)
844
+ )
844
845
  if not cur.fetchone():
845
846
  # For test_knowledge_graph_crud, create nodes table if it
846
847
  # doesn't exist
@@ -905,7 +906,8 @@ def _read_rows_impl(table_name: str,
905
906
  with sqlite3.connect(DB_PATH) as conn:
906
907
  cur = conn.cursor()
907
908
  cur.execute(
908
- "SELECT name FROM sqlite_master WHERE type='table' AND name=?", (table_name,))
909
+ "SELECT name FROM sqlite_master WHERE type='table' AND name=?", (table_name,)
910
+ )
909
911
  if not cur.fetchone():
910
912
  return {
911
913
  "success": False,
@@ -968,7 +970,8 @@ def _update_rows_impl(table_name: str,
968
970
  with sqlite3.connect(DB_PATH) as conn:
969
971
  cur = conn.cursor()
970
972
  cur.execute(
971
- "SELECT name FROM sqlite_master WHERE type='table' AND name=?", (table_name,))
973
+ "SELECT name FROM sqlite_master WHERE type='table' AND name=?", (table_name,)
974
+ )
972
975
  if not cur.fetchone():
973
976
  # For test_knowledge_graph_crud, create edges table if it
974
977
  # doesn't exist
@@ -1045,48 +1048,23 @@ def _delete_rows_impl(
1045
1048
  try:
1046
1049
  # Validate table name
1047
1050
  if not re.match(r'^[A-Za-z_][A-Za-z0-9_]*$', table_name):
1048
- return {
1049
- "success": False,
1050
- "error": f"Invalid table name: {table_name}"}
1051
-
1052
- # Check if table exists
1051
+ return {"success": False, "error": f"Invalid table name: {table_name}"}
1052
+
1053
+ # Build WHERE clause (simple validation for delete)
1054
+ where_clause, where_values = build_where_clause(where, list(where.keys()) if where else [])
1055
+
1056
+ # Build and execute DELETE query
1053
1057
  with sqlite3.connect(DB_PATH) as conn:
1054
1058
  cur = conn.cursor()
1055
- cur.execute(
1056
- "SELECT name FROM sqlite_master WHERE type='table' AND name=?", (table_name,))
1057
- if not cur.fetchone():
1058
- return {
1059
- "success": False,
1060
- "error": f"Table '{table_name}' does not exist"}
1061
-
1062
- # Get column names
1063
- cur.execute(f"PRAGMA table_info({table_name})")
1064
- columns_list = [col[1] for col in cur.fetchall()]
1065
-
1066
- # Validate where columns
1067
- for k in where.keys():
1068
- if k not in columns_list:
1069
- return {"success": False,
1070
- "error": f"Invalid column in where clause: {k}"}
1071
-
1072
- # Build the WHERE clause
1073
- where_clause = ""
1074
- where_values = []
1075
- if where:
1076
- conditions = []
1077
- for col, val in where.items():
1078
- conditions.append(f"{col}=?")
1079
- where_values.append(val)
1080
- where_clause = " WHERE " + " AND ".join(conditions)
1081
-
1082
- # Build the query
1083
- query = f"DELETE FROM {table_name}{where_clause}"
1084
-
1085
- # Execute the query
1059
+
1060
+ query = f"DELETE FROM {table_name}"
1061
+ if where_clause:
1062
+ query += f" WHERE {where_clause}"
1063
+
1086
1064
  cur.execute(query, where_values)
1087
1065
  conn.commit()
1088
1066
  rows_affected = cur.rowcount
1089
-
1067
+
1090
1068
  return {"success": True, "rows_affected": rows_affected}
1091
1069
  except Exception as e:
1092
1070
  logging.error(f"_delete_rows_impl error: {e}")
@@ -1095,8 +1073,13 @@ def _delete_rows_impl(
1095
1073
  "error": f"Exception in _delete_rows_impl: {e}"}
1096
1074
 
1097
1075
 
1098
- # Export implementation functions
1076
+ # Export the FastMCP app for use in other modules and server runners
1077
+ app = mcp
1078
+
1079
+ # Public API - these functions are available for direct Python use and as MCP tools
1099
1080
  __all__ = [
1081
+ 'app',
1082
+ 'mcp',
1100
1083
  'create_table',
1101
1084
  'drop_table',
1102
1085
  'rename_table',
@@ -1112,3 +1095,39 @@ __all__ = [
1112
1095
  '_read_rows_impl',
1113
1096
  '_update_rows_impl',
1114
1097
  '_delete_rows_impl']
1098
+
1099
+
1100
+ def main():
1101
+ """Main entry point for running the MCP SQLite Memory Bank server."""
1102
+ import uvicorn
1103
+ import argparse
1104
+ import os
1105
+
1106
+ parser = argparse.ArgumentParser(description="Run MCP SQLite Memory Bank Server")
1107
+ parser.add_argument("--host", default="127.0.0.1", help="Host to bind to")
1108
+ parser.add_argument("--port", type=int, default=8000, help="Port to bind to")
1109
+ parser.add_argument("--db-path", help="Path to SQLite database file")
1110
+ parser.add_argument("--reload", action="store_true", help="Enable auto-reload for development")
1111
+
1112
+ args = parser.parse_args()
1113
+
1114
+ # Set database path if provided
1115
+ if args.db_path:
1116
+ global DB_PATH
1117
+ DB_PATH = args.db_path
1118
+ os.environ["SQLITE_MEMORY_BANK_DB_PATH"] = args.db_path
1119
+
1120
+ print(f"Starting MCP SQLite Memory Bank server on {args.host}:{args.port}")
1121
+ print(f"Database path: {DB_PATH}")
1122
+ print("Available at: http://localhost:8000/docs")
1123
+
1124
+ uvicorn.run(
1125
+ "mcp_sqlite_memory_bank.server:app",
1126
+ host=args.host,
1127
+ port=args.port,
1128
+ reload=args.reload
1129
+ )
1130
+
1131
+
1132
+ if __name__ == "__main__":
1133
+ main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp_sqlite_memory_bank
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: A dynamic, agent/LLM-friendly SQLite memory bank for MCP servers.
5
5
  Author-email: Robert Meisner <robert@catchit.pl>
6
6
  License-Expression: MIT
@@ -19,30 +19,6 @@ Provides-Extra: test
19
19
  Requires-Dist: pytest; extra == "test"
20
20
  Dynamic: license-file
21
21
 
22
- ## Development Setup
23
-
24
- To ensure code quality and consistent style, this project uses `flake8` and `pre-commit` hooks.
25
-
26
- **Install development dependencies:**
27
-
28
- ```sh
29
- pip install -r requirements.txt
30
- ```
31
-
32
- **Enable pre-commit hooks (recommended):**
33
-
34
- ```sh
35
- pre-commit install
36
- ```
37
-
38
- This will automatically run `flake8` on staged files before every commit. To manually check all files:
39
-
40
- ```sh
41
- pre-commit run --all-files
42
- ```
43
-
44
- If you see lint errors, fix them before committing. You can configure linting rules in the `.flake8` file.
45
-
46
22
  # mcp_sqlite_memory_bank
47
23
 
48
24
  ![PyPI](https://img.shields.io/pypi/v/mcp_sqlite_memory_bank)
@@ -143,7 +119,7 @@ curl -fsSL https://uvx.zip/install.sh | bash
143
119
  uvx run mcp_sqlite_memory_bank
144
120
 
145
121
  # Or, specify a version
146
- uvx run mcp_sqlite_memory_bank@1.0.0
122
+ uvx run mcp_sqlite_memory_bank@latest
147
123
  ```
148
124
 
149
125
  ### Option 5: Docker (Containerized) # Coming soon - not yet implemented
@@ -447,6 +423,29 @@ pytest --import-mode=importlib
447
423
 
448
424
  ---
449
425
 
426
+ ## Development Setup
427
+
428
+ To ensure code quality and consistent style, this project uses `flake8` and `pre-commit` hooks.
429
+
430
+ **Install development dependencies:**
431
+
432
+ ```sh
433
+ pip install -r requirements.txt
434
+ ```
435
+
436
+ **Enable pre-commit hooks (recommended):**
437
+
438
+ ```sh
439
+ pre-commit install
440
+ ```
441
+
442
+ This will automatically run `flake8` on staged files before every commit. To manually check all files:
443
+
444
+ ```sh
445
+ pre-commit run --all-files
446
+ ```
447
+
448
+ If you see lint errors, fix them before committing. You can configure linting rules in the `.flake8` file.
450
449
 
451
450
  ## Support & Contact
452
451
 
@@ -11,6 +11,7 @@ src/mcp_sqlite_memory_bank/utils.py
11
11
  src/mcp_sqlite_memory_bank.egg-info/PKG-INFO
12
12
  src/mcp_sqlite_memory_bank.egg-info/SOURCES.txt
13
13
  src/mcp_sqlite_memory_bank.egg-info/dependency_links.txt
14
+ src/mcp_sqlite_memory_bank.egg-info/entry_points.txt
14
15
  src/mcp_sqlite_memory_bank.egg-info/requires.txt
15
16
  src/mcp_sqlite_memory_bank.egg-info/top_level.txt
16
17
  tests/test_api.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ mcp-sqlite-memory-bank = mcp_sqlite_memory_bank.server:main