vAirpower/Stardog-MCP-Server
If you are the rightful owner of Stardog-MCP-Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Stardog MCP Server bridges AI models and knowledge graphs, providing a seamless interface for AI systems to access semantic data.
Stardog MCP Server & AWS Strands Integration
๐ค Claude 3.7 Sonnet + AWS Strands Agent + Stardog Knowledge Graphs = Intelligent GEOINT Analysis
๐๏ธ Architecture Overview
This repository contains two interconnected components that work together to provide an intelligent, conversational interface to Stardog knowledge graphs:
โโโโโโโโโโโโโโโโโโโ HTTP/MCP โโโโโโโโโโโโโโโโโโโ SPARQL/GraphQL โโโโโโโโโโโโโโโโโโโ
โ Streamlit App โ โโโโโโโโโโโโโโ โ MCP Server โ โโโโโโโโโโโโโโโโโโโโ โ Stardog DB โ
โ โ โ โ โ โ
โ โข Claude 3.7 โ โ โข SPARQL Tools โ โ โข Knowledge โ
โ โข AWS Strands โ โ โข GraphQL API โ โ Graph โ
โ โข Chat UI โ โ โข Schema Tools โ โ โข GEOINT Data โ
โ โข Port 8501 โ โ โข Port 8000 โ โ โข Semantic Web โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
๐ง MCP Server (mcp-server/
)
- Purpose: Custom Model Context Protocol server for Stardog knowledge graphs
- Capabilities:
- SPARQL query execution and optimization
- GraphQL API for modern applications
- Schema discovery and ontology exploration
- Natural language to SPARQL conversion
- Deployment: Local development, Docker, or AWS ECS
- Port: 8000
- Technology: Python, FastAPI, MCP Protocol
๐ฅ๏ธ Streamlit App (streamlit-app/
)
- Purpose: Interactive chatbot with autonomous reasoning capabilities
- AI Model: Claude 3.7 Sonnet via AWS Bedrock Converse API
- Agent Framework: AWS Strands for intelligent tool orchestration
- Features:
- Natural language GEOINT queries
- Real-time knowledge graph exploration
- Multi-turn conversations with context
- Visual query suggestions and examples
- Port: 8501
- Technology: Streamlit, AWS Bedrock, Strands Agent
๐ Quick Start
Option 1: Docker Compose (Recommended)
# Clone the repository
git clone https://github.com/vAirpower/Stardog-MCP-Server.git
cd Stardog-MCP-Server
# Copy and configure environment files
cp mcp-server/.env.example .env
cp streamlit-app/.env.example .env.local
# Edit .env files with your Stardog and AWS configuration
nano .env # Configure Stardog connection
nano .env.local # Configure AWS Bedrock and Claude
# Start both services
docker-compose up --build
Access the application:
- ๐ฅ๏ธ Streamlit App: http://localhost:8501
- ๐ง MCP Server: http://localhost:8000
- ๐ Health Check: http://localhost:8000/health
Option 2: Manual Setup
# Terminal 1: Start MCP Server
cd mcp-server
pip install -r requirements.txt
python -m stardog_mcp_server.server
# Terminal 2: Start Streamlit App
cd streamlit-app
pip install -r requirements.txt
streamlit run app.py
Option 3: Demo Mode (No Stardog Required)
For testing without a Stardog instance, use the built-in demo server with synthetic GEOINT data:
# Start demo with synthetic data
docker-compose --profile demo up
# Or manually
cd streamlit-app
python standalone_server.py &
streamlit run app.py
๐ How Components Connect
- MCP Server exposes Stardog capabilities through standardized MCP tools over HTTP
- Streamlit App connects using the HTTP MCP Client for seamless integration
- AWS Strands Agent orchestrates Claude 3.7 Sonnet + MCP tools for autonomous reasoning
- Real-time queries enable conversational knowledge graph exploration
Example Interaction Flow:
User: "What military facilities are near Washington DC?"
โ
Strands Agent: Analyzes query โ Calls MCP tools โ Executes SPARQL
โ
MCP Server: Queries Stardog โ Returns structured results
โ
Claude 3.7: Processes results โ Generates natural language response
โ
User: Receives comprehensive answer with facility details
๐ ๏ธ Configuration
MCP Server Configuration
# mcp-server/.env
STARDOG_ENDPOINT=http://localhost:5820
STARDOG_USERNAME=admin
STARDOG_PASSWORD=admin
STARDOG_DATABASE=stardog
MCP_SERVER_HOST=0.0.0.0
MCP_SERVER_PORT=8000
Streamlit App Configuration
# streamlit-app/.env
AWS_REGION=us-east-1
BEDROCK_MODEL_ID=us.anthropic.claude-3-7-sonnet-20250219-v1:0
FUSEKI_MCP_SERVER_URL=http://localhost:8000
STREAMLIT_SERVER_PORT=8501
๐ Documentation
- - Setup, API reference, and deployment
- - Configuration, features, and usage
- - Technical deep-dive
- - AWS ECS and production setup
- - Getting started tutorial
- - Security best practices
๐งช Example Queries
Once running, try these sample queries in the Streamlit interface:
- "What facilities are in Virginia?" - Geographic filtering
- "Find all military bases with coordinates" - Type-based search
- "Show me the database schema" - Ontology exploration
- "What's connected to the Pentagon?" - Relationship queries
- "Convert this to SPARQL: Find airports" - Natural language processing
๐๏ธ Development
Project Structure
Stardog-MCP-Server/
โโโ mcp-server/ # MCP Server component
โ โโโ src/stardog_mcp_server/ # Core server implementation
โ โโโ infrastructure/ # CDK deployment code
โ โโโ README.md # Server-specific documentation
โโโ streamlit-app/ # Streamlit Application
โ โโโ app.py # Main Streamlit application
โ โโโ strands_agent.py # AWS Strands integration
โ โโโ mcp_http_client.py # MCP client implementation
โ โโโ README.md # App-specific documentation
โโโ deployment/ # CloudFormation templates
โโโ docs/ # Comprehensive documentation
โโโ docker-compose.yml # Multi-service orchestration
Contributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit changes:
git commit -m 'Add amazing feature'
- Push to branch:
git push origin feature/amazing-feature
- Open a Pull Request
๐ง Deployment
Local Development
- Use docker-compose for full stack development
- Individual components can be run separately for focused development
Production (AWS ECS)
- CloudFormation templates in
deployment/
- CDK infrastructure code in
mcp-server/infrastructure/
- See for detailed instructions
๐ Monitoring
- MCP Server Health:
GET /health
- Metrics Endpoint:
GET /metrics
- Streamlit Status: Built-in Streamlit monitoring
- AWS CloudWatch: Production monitoring and alerting
๐ค Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: See directory
๐ License
This project is licensed under the MIT License - see the file for details.
๐ Acknowledgments
- Anthropic for Claude 3.7 Sonnet
- AWS for Bedrock and Strands Agent framework
- Stardog for the knowledge graph platform
- Model Context Protocol for standardized AI tool integration
Ready to explore your knowledge graphs with AI? ๐
Get started with: docker-compose up --build