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

Feat/http mode #88

merged 17 commits into from
Jul 14, 2025

Conversation

rfrneo4j
Copy link
Collaborator

@rfrneo4j rfrneo4j commented Jul 8, 2025

Sorry for insanely large changeset here. Test cases are passing, servers look to be initializing correctly.

I'll be much more small and direct with any future contribs.

  • Upgrade all 4 Neo4j MCP servers from old mcp library to FastMCP 2.0
  • Add HTTP transport mode support to all servers ( STDIO, SSE, HTTP)
  • Update server dependencies to use fastmcp>=2.0.0
  • Add comprehensive HTTP transport integration tests
  • Update README documentation for all servers
  • Add Makefiles for build automation
  • Replace old integration tests with FastMCP 2.0 compatible tests
  • Add stateless_http=True for simplified HTTP deployment
  • Update server entry points and async/await patterns

rfrneo4j added 3 commits July 7, 2025 21:11
- Upgrade all 4 Neo4j MCP servers from old mcp library to FastMCP 2.0
- Add HTTP transport mode support to all servers (STDIO, SSE, HTTP)
- Update server dependencies to use fastmcp>=2.0.0
- Add comprehensive HTTP transport integration tests
- Update README documentation for all servers
- Add Makefiles for build automation
- Replace old integration tests with FastMCP 2.0 compatible tests
- Add stateless_http=True for simplified HTTP deployment
- Update server entry points and async/await patterns
- Ensure all servers work with Server-Sent Events (SSE) responses
- Add parse_sse_response() helper function to extract JSON from SSE format
- Update all HTTP transport tests to use SSE parsing instead of direct JSON
- Fix error handling to work with FastMCP 2.0's error format with isError field
- All HTTP transport tests now pass with FastMCP 2.0
@rfrneo4j rfrneo4j requested review from jexp and a-s-g93 July 8, 2025 18:56
rfrneo4j added 2 commits July 8, 2025 14:58
- Fix mcp-neo4j-cloud-aura-api/test.sh to run 'pytest tests' instead of 'pytest tests/test_aura_manager.py'
- Fix mcp-neo4j-memory/test.sh to run 'pytest tests' instead of 'pytest tests/test_neo4j_memory_integration.py'
- These files were looking for test files in the wrong paths, causing CI/CD failures
- Add missing assertions to use result variables in test_invalid_node_data and test_invalid_data_model
- Fix F841 linting errors (unused variables)
- Tests now properly validate response structure
}

# Add optional parameters only if they're provided and applicable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you verify that the logic still works?

Copy link
Collaborator

@a-s-g93 a-s-g93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all your work on this!

In general

Comment on lines 49 to 54
try:
# TODO ,
query = """
CREATE FULLTEXT INDEX search IF NOT EXISTS FOR (m:Memory) ON EACH [m.name, m.type, m.observations];
"""
self.neo4j_driver.execute_query(query)
logger.info("Created fulltext search index")
except neo4j.exceptions.ClientError as e:
if "An index with this name already exists" in str(e):
logger.info("Fulltext search index already exists")
else:
raise e
self.driver = neo4j_driver

async def create_fulltext_index(self):
"""Create a fulltext search index for entities if it doesn't exist."""
async with self.driver.session() as session:
try:
await session.run("""
CALL db.index.fulltext.createNodeIndex("entity_search", ["Entity"], ["name", "type", "observations"])
""")
except Exception as e:
# Index might already exist, which is fine
logger.debug(f"Fulltext index creation: {e}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can keep the driver.execute_query() method here to simplify the function. I'm planning on refactoring the Cypher MCP server as well to implement this and clean up the query logic.

Comment on lines 67 to 71
entities.append(Entity(
name=record["name"],
type=record["type"],
observations=record["observations"] if record["observations"] else []
))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be safer to keep the .get() methods here in case any of these fields are populated

Comment on lines 81 to 85
relations.append(Relation(
source=record["source"],
target=record["target"],
relationType=record["relationType"]
))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same idea as above re: keeping the .get() method

@a-s-g93
Copy link
Collaborator

a-s-g93 commented Jul 14, 2025

@rfrneo4j can you review the changelogs to make sure I didn't miss any other changes?

@a-s-g93 a-s-g93 merged commit 4b67389 into main Jul 14, 2025
4 checks passed
@a-s-g93 a-s-g93 deleted the feat/http-mode branch July 14, 2025 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants