mcpassistant-gateway 0.1.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,27 @@
1
+ node_modules
2
+ .env
3
+ .env.local
4
+ dist
5
+ *.log
6
+ .DS_Store
7
+ docs/build_log*.txt
8
+
9
+ # Playwright
10
+ test-results/
11
+ playwright-report/
12
+ report.json
13
+ .last-run.json
14
+ error.txt
15
+
16
+ # Python
17
+ __pycache__/
18
+ *.py[cod]
19
+ *.pyo
20
+ *.pyd
21
+ *.egg-info/
22
+ .pytest_cache/
23
+ .mypy_cache/
24
+ .ruff_cache/
25
+ .venv/
26
+ venv/
27
+ build/
@@ -0,0 +1,78 @@
1
+ Metadata-Version: 2.4
2
+ Name: mcpassistant-gateway
3
+ Version: 0.1.0
4
+ Summary: Local outbound bridge agent for MCP capability forwarding
5
+ Author: Your Name
6
+ Requires-Python: >=3.11
7
+ Requires-Dist: httpx<1.0.0,>=0.28.1
8
+ Requires-Dist: mcp<2.0.0,>=1.6.0
9
+ Requires-Dist: pyjwt<3.0.0,>=2.10.1
10
+ Requires-Dist: python-dotenv<2.0.0,>=1.0.1
11
+ Requires-Dist: websockets<16.0.0,>=15.0.1
12
+ Description-Content-Type: text/markdown
13
+
14
+ # mcpassistant-gateway
15
+
16
+ Async local bridge that connects outbound to the remote MCP bridge over WSS and forwards invoke requests to local MCP servers using the MCP Python client library.
17
+
18
+ ## Run
19
+
20
+ ```bash
21
+ pip install -e .
22
+ mcpassistant-gateway
23
+ ```
24
+
25
+ `mcpassistant-gateway` initializes MCP client sessions for configured `mcpServers` (stdio) and opens the outbound bridge connection to the remote server.
26
+
27
+ Startup token behavior:
28
+ - If `AGENT_JWT` is already configured (env or `config.json`), startup continues without prompting.
29
+ - If `AGENT_JWT` is missing, the CLI shows a styled prompt and asks you to paste the token.
30
+ - If WebSocket auth fails with `HTTP 403`, the CLI asks for a fresh `AGENT_JWT` and retries immediately.
31
+ - `AGENT_ID` is auto-derived from JWT claims (or token fingerprint fallback), so no manual `AGENT_ID` prompt.
32
+ - Prompted values are saved into resolved `config.json`, so next runs do not ask again.
33
+
34
+ Set `START_MCP_SERVERS=false` if you only want the bridge process.
35
+
36
+ Configuration can be provided through `.env` and/or `config.json`.
37
+
38
+ Minimal dynamic `.env`:
39
+
40
+ ```env
41
+ REMOTE_SERVER_BASE_URL=https://your-remote-domain
42
+ AGENT_JWT=your_agent_jwt
43
+ ```
44
+
45
+ With this mode:
46
+ - `REMOTE_WEBSOCKET_URL` is derived as `wss://.../connect`
47
+ - `AGENT_ID` and `CAPABILITIES` are derived from JWT claims (`sub`, `capabilities`) if not explicitly set
48
+ - Local MCP calls are handled via MCP client sessions for `mcpServers`
49
+
50
+ ## mcpServers + mcpassistant-gateway-bridge
51
+
52
+ You can run MCP servers from config (supergateway-style) and derive local HTTP endpoints:
53
+
54
+ ```json
55
+ {
56
+ "mcpServers": {
57
+ "filesystem": {
58
+ "command": "npx",
59
+ "args": ["-y", "supergateway", "--stdio", "npx", "-y", "@modelcontextprotocol/server-filesystem", "--port", "3004"],
60
+ "port": 3004
61
+ }
62
+ }
63
+ }
64
+ ```
65
+
66
+ Run one server:
67
+
68
+ ```bash
69
+ mcpassistant-gateway-bridge --config ./config.json --name filesystem
70
+ ```
71
+
72
+ Run all servers in config:
73
+
74
+ ```bash
75
+ mcpassistant-gateway-bridge --config ./config.json
76
+ ```
77
+
78
+
@@ -0,0 +1,65 @@
1
+ # mcpassistant-gateway
2
+
3
+ Async local bridge that connects outbound to the remote MCP bridge over WSS and forwards invoke requests to local MCP servers using the MCP Python client library.
4
+
5
+ ## Run
6
+
7
+ ```bash
8
+ pip install -e .
9
+ mcpassistant-gateway
10
+ ```
11
+
12
+ `mcpassistant-gateway` initializes MCP client sessions for configured `mcpServers` (stdio) and opens the outbound bridge connection to the remote server.
13
+
14
+ Startup token behavior:
15
+ - If `AGENT_JWT` is already configured (env or `config.json`), startup continues without prompting.
16
+ - If `AGENT_JWT` is missing, the CLI shows a styled prompt and asks you to paste the token.
17
+ - If WebSocket auth fails with `HTTP 403`, the CLI asks for a fresh `AGENT_JWT` and retries immediately.
18
+ - `AGENT_ID` is auto-derived from JWT claims (or token fingerprint fallback), so no manual `AGENT_ID` prompt.
19
+ - Prompted values are saved into resolved `config.json`, so next runs do not ask again.
20
+
21
+ Set `START_MCP_SERVERS=false` if you only want the bridge process.
22
+
23
+ Configuration can be provided through `.env` and/or `config.json`.
24
+
25
+ Minimal dynamic `.env`:
26
+
27
+ ```env
28
+ REMOTE_SERVER_BASE_URL=https://your-remote-domain
29
+ AGENT_JWT=your_agent_jwt
30
+ ```
31
+
32
+ With this mode:
33
+ - `REMOTE_WEBSOCKET_URL` is derived as `wss://.../connect`
34
+ - `AGENT_ID` and `CAPABILITIES` are derived from JWT claims (`sub`, `capabilities`) if not explicitly set
35
+ - Local MCP calls are handled via MCP client sessions for `mcpServers`
36
+
37
+ ## mcpServers + mcpassistant-gateway-bridge
38
+
39
+ You can run MCP servers from config (supergateway-style) and derive local HTTP endpoints:
40
+
41
+ ```json
42
+ {
43
+ "mcpServers": {
44
+ "filesystem": {
45
+ "command": "npx",
46
+ "args": ["-y", "supergateway", "--stdio", "npx", "-y", "@modelcontextprotocol/server-filesystem", "--port", "3004"],
47
+ "port": 3004
48
+ }
49
+ }
50
+ }
51
+ ```
52
+
53
+ Run one server:
54
+
55
+ ```bash
56
+ mcpassistant-gateway-bridge --config ./config.json --name filesystem
57
+ ```
58
+
59
+ Run all servers in config:
60
+
61
+ ```bash
62
+ mcpassistant-gateway-bridge --config ./config.json
63
+ ```
64
+
65
+
@@ -0,0 +1,19 @@
1
+ {
2
+ "mcpServers": {
3
+ "filesystem": {
4
+ "command": "npx",
5
+ "args": [
6
+ "@modelcontextprotocol/server-filesystem",
7
+ "C:/Users/Harish_Mehta/Desktop/my_dirs/workspace/mcp-ts"
8
+ ]
9
+ },
10
+ "windows-mcp": {
11
+ "command": "uvx",
12
+ "args": [
13
+ "windows-mcp"
14
+ ]
15
+ }
16
+ },
17
+ "jwt_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJITkdYR0ZQSjYzIiwicm9sZSI6ImFnZW50IiwiY2FwYWJpbGl0aWVzIjpbIioiXSwiZXhwIjoxNzcyNzI5ODgzfQ.JcsRvhcvR7wS0z2mxWUO1stibQ2DuwK-pJ4WHG0pp9g",
18
+ "agent_id": "HNGXGFPJ63"
19
+ }
@@ -0,0 +1,27 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.25.0"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "mcpassistant-gateway"
7
+ version = "0.1.0"
8
+ description = "Local outbound bridge agent for MCP capability forwarding"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ authors = [{ name = "Your Name" }]
12
+ dependencies = [
13
+ "httpx>=0.28.1,<1.0.0",
14
+ "websockets>=15.0.1,<16.0.0",
15
+ "python-dotenv>=1.0.1,<2.0.0",
16
+ "PyJWT>=2.10.1,<3.0.0",
17
+ "mcp>=1.6.0,<2.0.0",
18
+ ]
19
+
20
+ [project.scripts]
21
+ mcpassistant-gateway = "mcp_local_agent.agent:cli"
22
+ mcpassistant-gateway-bridge = "mcp_local_agent.bridge_server:cli"
23
+ bridgeserver = "mcp_local_agent.bridge_server:cli"
24
+
25
+ [tool.hatch.build.targets.wheel]
26
+ packages = ["src/mcp_local_agent"]
27
+
@@ -0,0 +1 @@
1
+ __all__ = ["LocalBridgeAgent", "load_config"]
@@ -0,0 +1,5 @@
1
+ from .agent import cli
2
+
3
+
4
+ if __name__ == "__main__":
5
+ cli()