From beffed840e8ca000ad8abc7cc9f8fb5457b9096a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D0=B8=D0=BB=20=D0=92=D0=B8=D0=BA?= =?UTF-8?q?=D1=82=D0=BE=D1=80=D0=BE=D0=B2?= Date: Thu, 2 Jul 2026 02:39:19 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20memory=5Fclient.py=20=E2=80=94=20MCP-?= =?UTF-8?q?=D1=81=D0=B5=D1=80=D0=B2=D0=B5=D1=80=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D1=83=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=BF=D0=B0=D0=BC=D1=8F=D1=82=D1=8C=D1=8E=20=D0=B0=D0=B3=D0=B5?= =?UTF-8?q?=D0=BD=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- memory_client.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 memory_client.py diff --git a/memory_client.py b/memory_client.py new file mode 100644 index 0000000..54554e8 --- /dev/null +++ b/memory_client.py @@ -0,0 +1,31 @@ +import asyncio +from fastmcp import Client + + +async def main(): + client = Client("python memory_server.py") + await client.connect() + try: + # Save a value in default namespace + saved = await client.call_tool( + "save_with_namespace", + {"key": "username", "value": "Алексей", "namespace": "default"}, + ) + print(f"Saved: {saved}") + + # Retrieve all values from default namespace + data = await client.call_tool("get_by_namespace", {"namespace": "default"}) + print("Namespace 'default' contents:") + for item in data: + print(f" {item['key']}: {item['value']} (ts={item['timestamp']})") + + # List keys matching pattern + keys = await client.call_tool("list_keys", {"pattern": "*name"}) + print(f"Keys matching '*name': {keys}") + + finally: + await client.close() + + +if __name__ == "__main__": + asyncio.run(main()) \ No newline at end of file