Labsco
MCP SERVER

Adaptive Graph of Thoughts

by SaptaDey

Scientific reasoning backed by a Neo4j knowledge graph — hypotheses scored with confidence, concept relationships explored to a chosen depth, and claims validated with counter-evidence.

Reasoning Scaffolds & Agent Workflow Engines
Summary
Neo4j with APOC is a hard prerequisite, not an optional backend.

The reasoning stages issue APOC procedure calls directly, so a plain Neo4j install fails in ways that look like application bugs — the Compose files exist precisely to avoid that. What you get for the setup cost is a reasoning trace you can inspect: the graph state comes back with the answer, so a conclusion can be traced to the evidence nodes that produced it.

What it is

An MCP server implementing the Advanced Scientific Reasoning Graph-of-Thoughts framework on top of a Neo4j graph database. The graph is the working memory: nodes are concepts, hypotheses and evidence, edges are the semantic and logical relationships between them, and the reasoning stages build and traverse it. Responses can include the reasoning trace and the graph state alongside the answer.

What you get
  • A scientific question answered through graph-based analysis, with optional reasoning trace, graph state, a cap on graph nodes in the response, and a summary or detailed output level — `scientific_reasoning_query`
  • A research hypothesis evaluated with confidence scoring, optionally scoped to a research domain and pointed at external evidence sources — `analyze_research_hypothesis`
  • Relationships between concepts explored to a chosen depth from 1 to 5, with the relationship types you care about — `explore_scientific_relationships`
  • A claim validated against existing evidence with a confidence threshold, your own validation criteria, and contradictory evidence included on request — `validate_scientific_claims`
  • Session tracking across calls through a session identifier, so a line of reasoning continues rather than restarting
  • An HTTP surface alongside MCP: `POST /mcp` for MCP clients and `GET /health` for status
Requirements

A running Neo4j instance with the APOC library installed — several reasoning stages call APOC procedures such as `apoc.create.addLabels` and `apoc.merge.node`, and without it the application will not work correctly. Connection details go in `config/settings.yaml` or in `NEO4J_URI`, `NEO4J_USER`, `NEO4J_PASSWORD` and `NEO4J_DATABASE`. Python 3.11+ with Poetry: `poetry install`, then run the server directly or through uvicorn on port 8000. The provided `docker-compose.yml` and `docker-compose.prod.yml` already include a Neo4j service with APOC configured, which is the simplest way to satisfy that requirement. `MCP_TRANSPORT_TYPE` chooses `stdio` or `http`, `ENABLE_EVIDENCE_SOURCES` turns on external evidence gathering, and `SECRETS_PROVIDER` set to `aws`, `gcp` or `vault` loads API keys and the Neo4j password from a secrets manager at startup. Run `scripts/run_cypher_migrations.py` to create the recommended indexes.

Setup effort

One command plus a key — poetry install, then supply credentials