mcp-sqlite-memory-bank 1.1.1__tar.gz → 1.2.1__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.
- {mcp_sqlite_memory_bank-1.1.1/src/mcp_sqlite_memory_bank.egg-info → mcp_sqlite_memory_bank-1.2.1}/PKG-INFO +2 -2
- {mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/README.md +1 -1
- {mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/pyproject.toml +5 -1
- {mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/src/mcp_sqlite_memory_bank/server.py +56 -37
- {mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1/src/mcp_sqlite_memory_bank.egg-info}/PKG-INFO +2 -2
- {mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/src/mcp_sqlite_memory_bank.egg-info/SOURCES.txt +1 -0
- mcp_sqlite_memory_bank-1.2.1/src/mcp_sqlite_memory_bank.egg-info/entry_points.txt +3 -0
- {mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/LICENSE +0 -0
- {mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/MANIFEST.in +0 -0
- {mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/setup.cfg +0 -0
- {mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/src/mcp_sqlite_memory_bank/__init__.py +0 -0
- {mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/src/mcp_sqlite_memory_bank/py.typed +0 -0
- {mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/src/mcp_sqlite_memory_bank/types.py +0 -0
- {mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/src/mcp_sqlite_memory_bank/utils.py +0 -0
- {mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/src/mcp_sqlite_memory_bank.egg-info/dependency_links.txt +0 -0
- {mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/src/mcp_sqlite_memory_bank.egg-info/requires.txt +0 -0
- {mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/src/mcp_sqlite_memory_bank.egg-info/top_level.txt +0 -0
- {mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/tests/test_api.py +0 -0
- {mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/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.
|
3
|
+
Version: 1.2.1
|
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
|
@@ -119,7 +119,7 @@ curl -fsSL https://uvx.zip/install.sh | bash
|
|
119
119
|
uvx run mcp_sqlite_memory_bank
|
120
120
|
|
121
121
|
# Or, specify a version
|
122
|
-
uvx run mcp_sqlite_memory_bank@
|
122
|
+
uvx run mcp_sqlite_memory_bank@latest
|
123
123
|
```
|
124
124
|
|
125
125
|
### Option 5: Docker (Containerized) # Coming soon - not yet implemented
|
@@ -98,7 +98,7 @@ curl -fsSL https://uvx.zip/install.sh | bash
|
|
98
98
|
uvx run mcp_sqlite_memory_bank
|
99
99
|
|
100
100
|
# Or, specify a version
|
101
|
-
uvx run mcp_sqlite_memory_bank@
|
101
|
+
uvx run mcp_sqlite_memory_bank@latest
|
102
102
|
```
|
103
103
|
|
104
104
|
### Option 5: Docker (Containerized) # Coming soon - not yet implemented
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "mcp_sqlite_memory_bank"
|
7
|
-
version = "1.
|
7
|
+
version = "1.2.1"
|
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,10 @@ 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
|
+
mcp_sqlite_memory_bank = "mcp_sqlite_memory_bank.server:main"
|
29
|
+
|
26
30
|
[project.urls]
|
27
31
|
Homepage = "https://github.com/robertmeisner/mcp_sqlite_memory_bank"
|
28
32
|
Source = "https://github.com/robertmeisner/mcp_sqlite_memory_bank"
|
{mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/src/mcp_sqlite_memory_bank/server.py
RENAMED
@@ -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,44 +1048,19 @@ 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
|
+
return {"success": False, "error": f"Invalid table name: {table_name}"}
|
1051
1052
|
|
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
1059
|
|
1082
|
-
|
1083
|
-
|
1060
|
+
query = f"DELETE FROM {table_name}"
|
1061
|
+
if where_clause:
|
1062
|
+
query += f" WHERE {where_clause}"
|
1084
1063
|
|
1085
|
-
# Execute the query
|
1086
1064
|
cur.execute(query, where_values)
|
1087
1065
|
conn.commit()
|
1088
1066
|
rows_affected = cur.rowcount
|
@@ -1095,8 +1073,13 @@ def _delete_rows_impl(
|
|
1095
1073
|
"error": f"Exception in _delete_rows_impl: {e}"}
|
1096
1074
|
|
1097
1075
|
|
1098
|
-
# Export
|
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.
|
3
|
+
Version: 1.2.1
|
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
|
@@ -119,7 +119,7 @@ curl -fsSL https://uvx.zip/install.sh | bash
|
|
119
119
|
uvx run mcp_sqlite_memory_bank
|
120
120
|
|
121
121
|
# Or, specify a version
|
122
|
-
uvx run mcp_sqlite_memory_bank@
|
122
|
+
uvx run mcp_sqlite_memory_bank@latest
|
123
123
|
```
|
124
124
|
|
125
125
|
### Option 5: Docker (Containerized) # Coming soon - not yet implemented
|
@@ -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
|
File without changes
|
File without changes
|
File without changes
|
{mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/src/mcp_sqlite_memory_bank/__init__.py
RENAMED
File without changes
|
{mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/src/mcp_sqlite_memory_bank/py.typed
RENAMED
File without changes
|
{mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/src/mcp_sqlite_memory_bank/types.py
RENAMED
File without changes
|
{mcp_sqlite_memory_bank-1.1.1 → mcp_sqlite_memory_bank-1.2.1}/src/mcp_sqlite_memory_bank/utils.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|