Skip to content

Commit 977180c

Browse files
committed
update aura manager tests , cli and env args
1 parent 6d359e5 commit 977180c

File tree

5 files changed

+38
-5
lines changed

5 files changed

+38
-5
lines changed
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: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
install-dev:
2-
python3 -m uv pip install -e .
2+
uv sync
33

44
test-unit:
5-
python3 -m pytest tests/unit/ -v
5+
uv run pytest tests/unit/ -v
66

77
test-integration:
8-
python3 -m pytest tests/integration/ -v
8+
uv run pytest tests/integration/ -v
99

1010
test-http:
11-
python3 -m pytest tests/integration/test_http_transport.py -v
11+
uv run pytest tests/integration/test_http_transport.py -v
1212

1313
test-all:
14-
python3 -m pytest tests/ -v
14+
uv run pytest tests/ -v
1515

1616
all: install-dev test-all

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

Lines changed: 8 additions & 0 deletions
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

@@ -29,6 +33,10 @@ def main():
2933
asyncio.run(server.main(
3034
args.client_id,
3135
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/"),
3240
))
3341
except KeyboardInterrupt:
3442
logger.info("Server stopped by user")

servers/mcp-neo4j-cloud-aura-api/tests/integration/test_http_transport.py renamed to servers/mcp-neo4j-cloud-aura-api/tests/integration/test_http_transport_IT.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@
1010

1111
logger = logging.getLogger(__name__)
1212

13+
async def parse_sse_response(response: aiohttp.ClientResponse) -> dict:
14+
"""Parse Server-Sent Events response from FastMCP 2.0."""
15+
content = await response.text()
16+
lines = content.strip().split('\n')
17+
18+
# Find the data line that contains the JSON
19+
for line in lines:
20+
if line.startswith('data: '):
21+
json_str = line[6:] # Remove 'data: ' prefix
22+
return json.loads(json_str)
23+
24+
raise ValueError("No data line found in SSE response")
25+
1326
# Skip all tests if credentials are not available
1427
pytestmark = pytest.mark.skipif(
1528
not os.environ.get("NEO4J_AURA_CLIENT_ID") or not os.environ.get("NEO4J_AURA_CLIENT_SECRET"),

0 commit comments

Comments
 (0)