Skip to content

Feat/http mode #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Jul 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,36 @@ Create and destroy instances, find instances by name, scale them up and down and

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

## Transport Modes

All servers support multiple transport modes:

- **STDIO** (default): Standard input/output for local tools and Claude Desktop integration
- **SSE**: Server-Sent Events for web-based deployments
- **HTTP**: Streamable HTTP for modern web deployments and microservices

### HTTP Transport Configuration

To run a server in HTTP mode, use the `--transport http` flag:

```bash
# Basic HTTP mode
mcp-neo4j-cypher --transport http

# Custom HTTP configuration
mcp-neo4j-cypher --transport http --host 0.0.0.0 --port 8080 --path /api/mcp/
```

Environment variables are also supported:

```bash
export NEO4J_TRANSPORT=http
export NEO4J_MCP_SERVER_HOST=0.0.0.0
export NEO4J_MCP_SERVER_PORT=8080
export NEO4J_MCP_SERVER_PATH=/api/mcp/
mcp-neo4j-cypher
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.
Expand Down
12 changes: 12 additions & 0 deletions servers/mcp-neo4j-cloud-aura-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Next

### Fixed

### Changed
* Migrate to FastMCP v2.x

### Added
* Add HTTP transport option

## v0.2.2
...
16 changes: 16 additions & 0 deletions servers/mcp-neo4j-cloud-aura-api/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
install-dev:
uv sync

test-unit:
uv run pytest tests/unit/ -v

test-integration:
uv run pytest tests/integration/ -v

test-http:
uv run pytest tests/integration/test_http_transport.py -v

test-all:
uv run pytest tests/ -v

all: install-dev test-all
30 changes: 30 additions & 0 deletions servers/mcp-neo4j-cloud-aura-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,36 @@ Alternatively, you can set environment variables:
}
```

### 🌐 HTTP Transport Mode

The server supports HTTP transport for web-based deployments and microservices:

```bash
# Basic HTTP mode (defaults: host=127.0.0.1, port=8000, path=/mcp/)
mcp-neo4j-aura-manager --transport http

# Custom HTTP configuration
mcp-neo4j-aura-manager --transport http --host 0.0.0.0 --port 8080 --path /api/mcp/
```

Environment variables for HTTP configuration:

```bash
export NEO4J_TRANSPORT=http
export NEO4J_MCP_SERVER_HOST=0.0.0.0
export NEO4J_MCP_SERVER_PORT=8080
export NEO4J_MCP_SERVER_PATH=/api/mcp/
mcp-neo4j-aura-manager
```

### 🔄 Transport Modes

The server supports three transport modes:

- **STDIO** (default): Standard input/output for local tools and Claude Desktop
- **SSE**: Server-Sent Events for web-based deployments
- **HTTP**: Streamable HTTP for modern web deployments and microservices

## 📝 Usage Examples

### 🔍 Give overview over my tenants
Expand Down
3 changes: 2 additions & 1 deletion servers/mcp-neo4j-cloud-aura-api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "MCP Neo4j Aura Database Instance Manager"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
"mcp>=1.6.0",
"fastmcp>=2.0.0",
"requests>=2.31.0",
]

Expand All @@ -18,6 +18,7 @@ dev-dependencies = [
"pyright>=1.1.389",
"pytest>=8.3.5",
"pytest-asyncio>=0.25.3",
"aiohttp>=3.8.0",
]

[project.scripts]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ def main():
default=os.environ.get("NEO4J_AURA_CLIENT_ID"))
parser.add_argument("--client-secret", help="Neo4j Aura API Client Secret",
default=os.environ.get("NEO4J_AURA_CLIENT_SECRET"))
parser.add_argument("--transport", default=None, help="Transport type")
parser.add_argument("--server-host", default=None, help="Server host")
parser.add_argument("--server-port", default=None, help="Server port")
parser.add_argument("--server-path", default=None, help="Server path")

args = parser.parse_args()

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

try:
asyncio.run(server.main(args.client_id, args.client_secret))
asyncio.run(server.main(
args.client_id,
args.client_secret,
args.transport or os.getenv("NEO4J_TRANSPORT", "stdio"),
args.server_host or os.getenv("NEO4J_MCP_SERVER_HOST", "127.0.0.1"),
args.server_port or os.getenv("NEO4J_MCP_SERVER_PORT", 8000),
args.server_path or os.getenv("NEO4J_MCP_SERVER_PATH", "/mcp/"),
))
except KeyboardInterrupt:
logger.info("Server stopped by user")
except Exception as e:
Expand Down
Loading