⚠️ Proof of Concept - This is a prototype implementation for exploring how discourse graphs can be integrated with AI assistants through the Model Context Protocol (MCP). It is intended for prototyping and experimental purposes only.
This MCP server exposes discourse graphs to AI assistants like Claude through the Model Context Protocol. It allows AI assistants to explore, search, and traverse structured knowledge graphs of research, supporting various node grammars and relationship types.
The server dynamically adapts to different discourse graph schemas, making it suitable for any domain or research area that uses the discourse graph format.
The server provides AI assistants with tools to:
- Search the knowledge graph using keywords and filters
- Retrieve detailed information about specific research nodes
- Traverse relationships between concepts, papers, and findings
- Query the ontology and relationship types
- View research images inline (automatically fetched and displayed)
- Analyze researcher contributions and statistics
All image content is served as native MCP image blocks (base64-encoded) for inline display in compatible MCP clients.
- Protocol: Model Context Protocol (MCP)
- Runtime: Node.js with TypeScript
- Data Format: JSON knowledge graph export
- Image Handling: Firebase URLs fetched and converted to base64 for inline display
search_nodes- Full-text search with type and property filters (supports any node type)get_node- Get complete node details with key imageget_linked_nodes- Graph traversal with typed relationshipsget_schema- Return dynamically loaded node type definitions from the datasetget_researcher_contributions- Attribution and statisticsget_node_images- Get all images for a node (inline display)get_relationships- Query typed relationships (Supports, Informs, Opposes, etc.)get_relation_types- List all available relationship type definitions
Key Feature: The server dynamically loads node schemas from each dataset, supporting different node grammars including:
- Research-focused types (Result, Question, Claim, Evidence, Hypothesis, Conclusion, etc.)
- Project management types (Flow, Artifact, Project, Issue, Milestone, etc.)
- Theory and methodology types (Theory, Source, etc.)
npm install
npm run buildnpm startDATA_PATH: Path to your discourse graph JSON file (required)SERVER_NAME: Custom server name (optional, auto-generated from filename if not provided)
# Using default data path (project root JSON file)
npm start
# Using custom data path
DATA_PATH=/path/to/your/graph.json npm start
# Using custom server name
SERVER_NAME=my-custom-server DATA_PATH=/path/to/graph.json npm startIf SERVER_NAME is not provided, the server automatically derives a name from the dataset filename:
| Filename | Auto-Generated Server Name |
|---|---|
discourse-graphs_query-results_202512290038.json |
discourse-graphs-server |
akamatsulab_query-results_202512290139.json |
akamatsulab-server |
mydata.json |
mydata-server |
Add to your MCP settings configuration (typically ~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"discourse-graph": {
"command": "node",
"args": ["/path/to/discourse-graph-mcp/dist/index.js"],
"env": {
"DATA_PATH": "/path/to/discourse-graphs_query-results.json"
}
}
}
}Run multiple discourse graph servers simultaneously with different datasets:
{
"mcpServers": {
"discourse-graphs": {
"command": "node",
"args": ["/Users/makamats/Repos/MCP-DG-demo/dist/index.js"],
"env": {
"DATA_PATH": "/Users/makamats/Repos/MCP-DG-demo/discourse-graphs_query-results_202512290038.json"
}
},
"akamatsulab": {
"command": "node",
"args": ["/Users/makamats/Repos/MCP-DG-demo/dist/index.js"],
"env": {
"DATA_PATH": "/Users/makamats/Repos/MCP-DG-demo/akamatsulab_query-results_202512290139.json"
}
}
}
}Note: The MCP client's configuration key (e.g., "discourse-graphs", "akamatsulab2") is independent of the internal server name. The server name is used in tool invocation and logging.
Override auto-generated names when needed:
{
"mcpServers": {
"production-graph": {
"command": "node",
"args": ["/path/to/discourse-graph-mcp/dist/index.js"],
"env": {
"SERVER_NAME": "production-discourse-graph",
"DATA_PATH": "/data/production/graph.json"
}
},
"staging-graph": {
"command": "node",
"args": ["/path/to/discourse-graph-mcp/dist/index.js"],
"env": {
"SERVER_NAME": "staging-discourse-graph",
"DATA_PATH": "/data/staging/graph.json"
}
}
}
}If you see errors about duplicate server names, ensure each server instance has a unique name:
- Use different
DATA_PATHvalues (server names auto-generated from filename) - OR explicitly set unique
SERVER_NAMEvalues via environment variables
ERROR: Data file not found: /path/to/file.json
- Verify
DATA_PATHpoints to an existing JSON file - Use absolute paths to avoid ambiguity
- Check file permissions
Check server startup logs (stderr) to verify configuration:
Loading discourse graph data...
Server name: discourse-graphs-server
Data path: /Users/makamats/Repos/MCP-DG-demo/discourse-graphs_query-results_202512290038.json
Loaded 425 nodes
src/
├── index.ts # Main MCP server entry point
├── tools.ts # Tool handlers and schemas
├── search.ts # Keyword search implementation
├── dataLoader.ts # JSON data loading and indexing
├── imageParser.ts # Firebase image URL extraction
└── types.ts # TypeScript types and schemas
This is a proof-of-concept implementation for exploring the integration of discourse graphs with AI assistants. It demonstrates:
- How structured knowledge graphs can be exposed through MCP
- Dynamic support for different node grammars and relationship types
- Inline image display capabilities for research content
- Graph traversal and typed relationship queries
- Full-text search over structured knowledge with attribution
- Multi-dataset support (run multiple servers for different graphs)
- Single static JSON data source (no live updates)
- Image fetching may be slow for large result sets
- Limited error handling and validation
- No authentication or access control
- Prototype-quality code not optimized for production
MIT
This is an experimental prototype. Contributions, suggestions, and feedback are welcome as we explore how discourse graphs can enhance AI-assisted research workflows.