Skip to content

Commit 4b67389

Browse files
authored
Merge pull request #88 from neo4j-contrib/feat/http-mode
Feat/http mode
2 parents 53ae31f + 8a2ed44 commit 4b67389

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+7798
-2210
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,36 @@ Create and destroy instances, find instances by name, scale them up and down and
3939

4040
Create, validate, and visualize Neo4j graph data models. Allows for model import/export from Arrows.app.
4141

42+
## Transport Modes
43+
44+
All servers support multiple transport modes:
45+
46+
- **STDIO** (default): Standard input/output for local tools and Claude Desktop integration
47+
- **SSE**: Server-Sent Events for web-based deployments
48+
- **HTTP**: Streamable HTTP for modern web deployments and microservices
49+
50+
### HTTP Transport Configuration
51+
52+
To run a server in HTTP mode, use the `--transport http` flag:
53+
54+
```bash
55+
# Basic HTTP mode
56+
mcp-neo4j-cypher --transport http
57+
58+
# Custom HTTP configuration
59+
mcp-neo4j-cypher --transport http --host 0.0.0.0 --port 8080 --path /api/mcp/
60+
```
61+
62+
Environment variables are also supported:
63+
64+
```bash
65+
export NEO4J_TRANSPORT=http
66+
export NEO4J_MCP_SERVER_HOST=0.0.0.0
67+
export NEO4J_MCP_SERVER_PORT=8080
68+
export NEO4J_MCP_SERVER_PATH=/api/mcp/
69+
mcp-neo4j-cypher
70+
```
71+
4272
## Contributing
4373

4474
Contributions are welcome! Please feel free to submit a Pull Request.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
## Next
2+
3+
### Fixed
4+
5+
### Changed
6+
* Migrate to FastMCP v2.x
7+
8+
### Added
9+
* Add HTTP transport option
10+
11+
## v0.2.2
12+
...
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
install-dev:
2+
uv sync
3+
4+
test-unit:
5+
uv run pytest tests/unit/ -v
6+
7+
test-integration:
8+
uv run pytest tests/integration/ -v
9+
10+
test-http:
11+
uv run pytest tests/integration/test_http_transport.py -v
12+
13+
test-all:
14+
uv run pytest tests/ -v
15+
16+
all: install-dev test-all

servers/mcp-neo4j-cloud-aura-api/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,36 @@ Alternatively, you can set environment variables:
164164
}
165165
```
166166

167+
### 🌐 HTTP Transport Mode
168+
169+
The server supports HTTP transport for web-based deployments and microservices:
170+
171+
```bash
172+
# Basic HTTP mode (defaults: host=127.0.0.1, port=8000, path=/mcp/)
173+
mcp-neo4j-aura-manager --transport http
174+
175+
# Custom HTTP configuration
176+
mcp-neo4j-aura-manager --transport http --host 0.0.0.0 --port 8080 --path /api/mcp/
177+
```
178+
179+
Environment variables for HTTP configuration:
180+
181+
```bash
182+
export NEO4J_TRANSPORT=http
183+
export NEO4J_MCP_SERVER_HOST=0.0.0.0
184+
export NEO4J_MCP_SERVER_PORT=8080
185+
export NEO4J_MCP_SERVER_PATH=/api/mcp/
186+
mcp-neo4j-aura-manager
187+
```
188+
189+
### 🔄 Transport Modes
190+
191+
The server supports three transport modes:
192+
193+
- **STDIO** (default): Standard input/output for local tools and Claude Desktop
194+
- **SSE**: Server-Sent Events for web-based deployments
195+
- **HTTP**: Streamable HTTP for modern web deployments and microservices
196+
167197
## 📝 Usage Examples
168198

169199
### 🔍 Give overview over my tenants

servers/mcp-neo4j-cloud-aura-api/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "MCP Neo4j Aura Database Instance Manager"
55
readme = "README.md"
66
requires-python = ">=3.10"
77
dependencies = [
8-
"mcp>=1.6.0",
8+
"fastmcp>=2.0.0",
99
"requests>=2.31.0",
1010
]
1111

@@ -18,6 +18,7 @@ dev-dependencies = [
1818
"pyright>=1.1.389",
1919
"pytest>=8.3.5",
2020
"pytest-asyncio>=0.25.3",
21+
"aiohttp>=3.8.0",
2122
]
2223

2324
[project.scripts]

servers/mcp-neo4j-cloud-aura-api/src/mcp_neo4j_aura_manager/__init__.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ def main():
1818
default=os.environ.get("NEO4J_AURA_CLIENT_ID"))
1919
parser.add_argument("--client-secret", help="Neo4j Aura API Client Secret",
2020
default=os.environ.get("NEO4J_AURA_CLIENT_SECRET"))
21+
parser.add_argument("--transport", default=None, help="Transport type")
22+
parser.add_argument("--server-host", default=None, help="Server host")
23+
parser.add_argument("--server-port", default=None, help="Server port")
24+
parser.add_argument("--server-path", default=None, help="Server path")
2125

2226
args = parser.parse_args()
2327

@@ -26,7 +30,14 @@ def main():
2630
sys.exit(1)
2731

2832
try:
29-
asyncio.run(server.main(args.client_id, args.client_secret))
33+
asyncio.run(server.main(
34+
args.client_id,
35+
args.client_secret,
36+
args.transport or os.getenv("NEO4J_TRANSPORT", "stdio"),
37+
args.server_host or os.getenv("NEO4J_MCP_SERVER_HOST", "127.0.0.1"),
38+
args.server_port or os.getenv("NEO4J_MCP_SERVER_PORT", 8000),
39+
args.server_path or os.getenv("NEO4J_MCP_SERVER_PATH", "/mcp/"),
40+
))
3041
except KeyboardInterrupt:
3142
logger.info("Server stopped by user")
3243
except Exception as e:

0 commit comments

Comments
 (0)