mimir-server-client 1.0.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.
@@ -0,0 +1,71 @@
1
+ Metadata-Version: 2.4
2
+ Name: mimir-server-client
3
+ Version: 1.0.0
4
+ Summary: Lightweight MCP proxy client for remote Mimir context servers — no repos, no models, no indexing needed
5
+ License: MIT
6
+ Project-URL: Homepage, https://github.com/repfly/mimir
7
+ Project-URL: Repository, https://github.com/repfly/mimir
8
+ Project-URL: Issues, https://github.com/repfly/mimir/issues
9
+ Keywords: mcp,context,code,llm,proxy,mimir
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Software Development :: Libraries
20
+ Classifier: Topic :: Software Development :: Documentation
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: aiohttp>=3.9
24
+ Requires-Dist: typer>=0.9
25
+
26
+ # mimir-client
27
+
28
+ Lightweight MCP proxy client for remote [Mimir](https://github.com/repfly/mimir) context servers.
29
+
30
+ No repos, no models, no indexing needed. Just point at a running Mimir HTTP server and get instant MCP access in your IDE.
31
+
32
+ ## Install
33
+
34
+ ```bash
35
+ pipx install mimir-client
36
+ ```
37
+
38
+ ## Usage
39
+
40
+ ### MCP proxy (for IDE integration)
41
+
42
+ ```bash
43
+ mimir-client serve http://your-server:8421
44
+ ```
45
+
46
+ Configure your IDE's MCP settings:
47
+
48
+ ```json
49
+ {
50
+ "mcpServers": {
51
+ "mimir": {
52
+ "command": "mimir-client",
53
+ "args": ["serve", "http://your-server:8421"]
54
+ }
55
+ }
56
+ }
57
+ ```
58
+
59
+ ### Health check
60
+
61
+ ```bash
62
+ mimir-client health http://your-server:8421
63
+ ```
64
+
65
+ ## How it works
66
+
67
+ `mimir-client` runs a local MCP stdio server that proxies all requests to a remote Mimir HTTP server. This lets developers use Mimir without needing the full server, repo access, or GPU for embeddings.
68
+
69
+ ## License
70
+
71
+ MIT
@@ -0,0 +1,46 @@
1
+ # mimir-client
2
+
3
+ Lightweight MCP proxy client for remote [Mimir](https://github.com/repfly/mimir) context servers.
4
+
5
+ No repos, no models, no indexing needed. Just point at a running Mimir HTTP server and get instant MCP access in your IDE.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ pipx install mimir-client
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ### MCP proxy (for IDE integration)
16
+
17
+ ```bash
18
+ mimir-client serve http://your-server:8421
19
+ ```
20
+
21
+ Configure your IDE's MCP settings:
22
+
23
+ ```json
24
+ {
25
+ "mcpServers": {
26
+ "mimir": {
27
+ "command": "mimir-client",
28
+ "args": ["serve", "http://your-server:8421"]
29
+ }
30
+ }
31
+ }
32
+ ```
33
+
34
+ ### Health check
35
+
36
+ ```bash
37
+ mimir-client health http://your-server:8421
38
+ ```
39
+
40
+ ## How it works
41
+
42
+ `mimir-client` runs a local MCP stdio server that proxies all requests to a remote Mimir HTTP server. This lets developers use Mimir without needing the full server, repo access, or GPU for embeddings.
43
+
44
+ ## License
45
+
46
+ MIT
@@ -0,0 +1,3 @@
1
+ """Mimir Client — thin MCP proxy for remote Mimir context servers."""
2
+
3
+ __version__ = "1.0.0"
@@ -0,0 +1,83 @@
1
+ """Minimal CLI for the Mimir remote proxy client."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import logging
6
+ import sys
7
+
8
+ import typer
9
+
10
+ app = typer.Typer(
11
+ name="mimir-client",
12
+ help="Mimir Client — connect your IDE to a remote Mimir context server.",
13
+ no_args_is_help=True,
14
+ )
15
+
16
+
17
+ @app.command()
18
+ def serve(
19
+ remote: str = typer.Argument(
20
+ ...,
21
+ help="URL of the remote Mimir HTTP server (e.g. http://team-server:8421)",
22
+ ),
23
+ verbose: bool = typer.Option(False, "--verbose", "-v", help="Enable debug logging"),
24
+ ) -> None:
25
+ """Start a local MCP proxy that forwards to a remote Mimir server.
26
+
27
+ Your IDE connects to this proxy via stdio. All queries are forwarded
28
+ to the remote HTTP server over the network.
29
+
30
+ \b
31
+ Example:
32
+ mimir-client serve http://team-server:8421
33
+ """
34
+ level = logging.DEBUG if verbose else logging.INFO
35
+ logging.basicConfig(
36
+ level=level,
37
+ format="%(asctime)s %(levelname)-8s %(name)s — %(message)s",
38
+ datefmt="%H:%M:%S",
39
+ stream=sys.stderr,
40
+ )
41
+
42
+ from mimir_client.proxy import run_remote_mcp
43
+ run_remote_mcp(remote)
44
+
45
+
46
+ @app.command()
47
+ def health(
48
+ remote: str = typer.Argument(
49
+ ...,
50
+ help="URL of the remote Mimir HTTP server (e.g. http://team-server:8421)",
51
+ ),
52
+ ) -> None:
53
+ """Check if a remote Mimir server is reachable and show its status."""
54
+ import asyncio
55
+
56
+ async def _check():
57
+ import aiohttp
58
+ url = remote.rstrip("/") + "/api/v1/health"
59
+ try:
60
+ async with aiohttp.ClientSession() as session:
61
+ async with session.get(url, timeout=aiohttp.ClientTimeout(total=5)) as resp:
62
+ if resp.status == 200:
63
+ data = await resp.json()
64
+ typer.echo(f"Status: {data.get('status', '?')}")
65
+ typer.echo(f"Workspace: {data.get('workspace', '?')}")
66
+ typer.echo(f"Nodes: {data.get('graph_nodes', '?')}")
67
+ typer.echo(f"Edges: {data.get('graph_edges', '?')}")
68
+ else:
69
+ typer.echo(f"Server returned HTTP {resp.status}", err=True)
70
+ raise typer.Exit(1)
71
+ except aiohttp.ClientError as exc:
72
+ typer.echo(f"Cannot reach server: {exc}", err=True)
73
+ raise typer.Exit(1)
74
+
75
+ asyncio.run(_check())
76
+
77
+
78
+ def main():
79
+ app()
80
+
81
+
82
+ if __name__ == "__main__":
83
+ main()
@@ -0,0 +1,138 @@
1
+ """Thin MCP stdio proxy that forwards to a remote Mimir HTTP server.
2
+
3
+ This is what developers use in their IDE config when they don't have
4
+ repos cloned locally. It reads JSON-RPC from stdin, POSTs to the
5
+ remote HTTP ``/api/v1/mcp`` endpoint, and writes the response back
6
+ to stdout.
7
+
8
+ No local repos, no local index, no local embedding model required.
9
+ """
10
+
11
+ from __future__ import annotations
12
+
13
+ import asyncio
14
+ import json
15
+ import logging
16
+ import sys
17
+
18
+ logger = logging.getLogger(__name__)
19
+
20
+
21
+ def run_remote_mcp(remote_url: str) -> None:
22
+ """Start a local MCP stdio server that proxies to a remote Mimir HTTP server.
23
+
24
+ Parameters
25
+ ----------
26
+ remote_url:
27
+ Base URL of the remote Mimir HTTP server, e.g. ``http://team-server:8421``.
28
+ """
29
+ remote_url = remote_url.rstrip("/")
30
+ mcp_endpoint = f"{remote_url}/api/v1/mcp"
31
+ health_endpoint = f"{remote_url}/api/v1/health"
32
+
33
+ logger.info("Remote MCP proxy starting — forwarding to %s", mcp_endpoint)
34
+
35
+ async def _check_health() -> bool:
36
+ """Verify the remote server is reachable before entering the main loop."""
37
+ try:
38
+ import aiohttp
39
+ async with aiohttp.ClientSession() as session:
40
+ async with session.get(health_endpoint, timeout=aiohttp.ClientTimeout(total=5)) as resp:
41
+ if resp.status == 200:
42
+ data = await resp.json()
43
+ logger.info(
44
+ "Remote server OK — workspace=%s, nodes=%s",
45
+ data.get("workspace", "?"),
46
+ data.get("graph_nodes", "?"),
47
+ )
48
+ return True
49
+ else:
50
+ logger.error("Remote server returned HTTP %d", resp.status)
51
+ return False
52
+ except Exception as exc:
53
+ logger.error("Cannot reach remote server at %s: %s", remote_url, exc)
54
+ return False
55
+
56
+ async def _forward_request(rpc_request: dict) -> dict:
57
+ """POST a JSON-RPC request to the remote server and return the response."""
58
+ import aiohttp
59
+
60
+ try:
61
+ async with aiohttp.ClientSession() as session:
62
+ async with session.post(
63
+ mcp_endpoint,
64
+ json=rpc_request,
65
+ timeout=aiohttp.ClientTimeout(total=60),
66
+ ) as resp:
67
+ if resp.status == 200:
68
+ return await resp.json()
69
+ else:
70
+ body = await resp.text()
71
+ logger.error("Remote error HTTP %d: %s", resp.status, body[:200])
72
+ return {
73
+ "jsonrpc": "2.0",
74
+ "id": rpc_request.get("id"),
75
+ "error": {
76
+ "code": -32000,
77
+ "message": f"Remote server error: HTTP {resp.status}",
78
+ },
79
+ }
80
+ except asyncio.TimeoutError:
81
+ return {
82
+ "jsonrpc": "2.0",
83
+ "id": rpc_request.get("id"),
84
+ "error": {"code": -32000, "message": "Remote server timeout"},
85
+ }
86
+ except Exception as exc:
87
+ logger.error("Forward failed: %s", exc)
88
+ return {
89
+ "jsonrpc": "2.0",
90
+ "id": rpc_request.get("id"),
91
+ "error": {"code": -32000, "message": f"Connection failed: {exc}"},
92
+ }
93
+
94
+ async def main_loop():
95
+ """Read JSON-RPC from stdin, forward to remote, write response to stdout."""
96
+ if not await _check_health():
97
+ logger.error("Exiting — remote server is not reachable")
98
+ sys.exit(1)
99
+
100
+ reader = asyncio.StreamReader()
101
+ protocol = asyncio.StreamReaderProtocol(reader)
102
+ await asyncio.get_event_loop().connect_read_pipe(lambda: protocol, sys.stdin)
103
+
104
+ loop = asyncio.get_event_loop()
105
+ write_transport, _ = await loop.connect_write_pipe(
106
+ asyncio.streams.FlowControlMixin, sys.stdout,
107
+ )
108
+
109
+ buffer = b""
110
+ while True:
111
+ try:
112
+ data = await reader.read(4096)
113
+ if not data:
114
+ break
115
+ buffer += data
116
+
117
+ while b"\n" in buffer:
118
+ line, buffer = buffer.split(b"\n", 1)
119
+ line = line.strip()
120
+ if not line:
121
+ continue
122
+ try:
123
+ request = json.loads(line)
124
+ response = await _forward_request(request)
125
+ if response and response.get("id") is not None:
126
+ out = json.dumps(response) + "\n"
127
+ write_transport.write(out.encode())
128
+ except json.JSONDecodeError:
129
+ continue
130
+ except asyncio.CancelledError:
131
+ break
132
+ except Exception as exc:
133
+ logger.error("Proxy loop error: %s", exc, exc_info=True)
134
+
135
+ try:
136
+ asyncio.run(main_loop())
137
+ except KeyboardInterrupt:
138
+ pass
@@ -0,0 +1,71 @@
1
+ Metadata-Version: 2.4
2
+ Name: mimir-server-client
3
+ Version: 1.0.0
4
+ Summary: Lightweight MCP proxy client for remote Mimir context servers — no repos, no models, no indexing needed
5
+ License: MIT
6
+ Project-URL: Homepage, https://github.com/repfly/mimir
7
+ Project-URL: Repository, https://github.com/repfly/mimir
8
+ Project-URL: Issues, https://github.com/repfly/mimir/issues
9
+ Keywords: mcp,context,code,llm,proxy,mimir
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Software Development :: Libraries
20
+ Classifier: Topic :: Software Development :: Documentation
21
+ Requires-Python: >=3.10
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: aiohttp>=3.9
24
+ Requires-Dist: typer>=0.9
25
+
26
+ # mimir-client
27
+
28
+ Lightweight MCP proxy client for remote [Mimir](https://github.com/repfly/mimir) context servers.
29
+
30
+ No repos, no models, no indexing needed. Just point at a running Mimir HTTP server and get instant MCP access in your IDE.
31
+
32
+ ## Install
33
+
34
+ ```bash
35
+ pipx install mimir-client
36
+ ```
37
+
38
+ ## Usage
39
+
40
+ ### MCP proxy (for IDE integration)
41
+
42
+ ```bash
43
+ mimir-client serve http://your-server:8421
44
+ ```
45
+
46
+ Configure your IDE's MCP settings:
47
+
48
+ ```json
49
+ {
50
+ "mcpServers": {
51
+ "mimir": {
52
+ "command": "mimir-client",
53
+ "args": ["serve", "http://your-server:8421"]
54
+ }
55
+ }
56
+ }
57
+ ```
58
+
59
+ ### Health check
60
+
61
+ ```bash
62
+ mimir-client health http://your-server:8421
63
+ ```
64
+
65
+ ## How it works
66
+
67
+ `mimir-client` runs a local MCP stdio server that proxies all requests to a remote Mimir HTTP server. This lets developers use Mimir without needing the full server, repo access, or GPU for embeddings.
68
+
69
+ ## License
70
+
71
+ MIT
@@ -0,0 +1,11 @@
1
+ README.md
2
+ pyproject.toml
3
+ mimir_client/__init__.py
4
+ mimir_client/cli.py
5
+ mimir_client/proxy.py
6
+ mimir_server_client.egg-info/PKG-INFO
7
+ mimir_server_client.egg-info/SOURCES.txt
8
+ mimir_server_client.egg-info/dependency_links.txt
9
+ mimir_server_client.egg-info/entry_points.txt
10
+ mimir_server_client.egg-info/requires.txt
11
+ mimir_server_client.egg-info/top_level.txt
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ mimir-client = mimir_client.cli:main
@@ -0,0 +1,2 @@
1
+ aiohttp>=3.9
2
+ typer>=0.9
@@ -0,0 +1,41 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68.0", "wheel>=0.46"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "mimir-server-client"
7
+ version = "1.0.0"
8
+ description = "Lightweight MCP proxy client for remote Mimir context servers — no repos, no models, no indexing needed"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = {text = "MIT"}
12
+ keywords = ["mcp", "context", "code", "llm", "proxy", "mimir"]
13
+ classifiers = [
14
+ "Development Status :: 4 - Beta",
15
+ "Environment :: Console",
16
+ "Intended Audience :: Developers",
17
+ "License :: OSI Approved :: MIT License",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.10",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ "Topic :: Software Development :: Libraries",
24
+ "Topic :: Software Development :: Documentation",
25
+ ]
26
+
27
+ dependencies = [
28
+ "aiohttp>=3.9",
29
+ "typer>=0.9",
30
+ ]
31
+
32
+ [project.urls]
33
+ Homepage = "https://github.com/repfly/mimir"
34
+ Repository = "https://github.com/repfly/mimir"
35
+ Issues = "https://github.com/repfly/mimir/issues"
36
+
37
+ [project.scripts]
38
+ mimir-client = "mimir_client.cli:main"
39
+
40
+ [tool.setuptools.packages.find]
41
+ include = ["mimir_client*"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+