MCP (Model Context Protocol) server providing unified access to 27 Oracle schemas, Graylog logs, and Elasticsearch data.
| Tool | Description |
|---|---|
execute_sql |
Run SELECT queries against any Oracle schema |
get_schemas |
Load schema mapping files (full or filtered) |
find_table |
Search for a table across all schemas |
search_schemas |
Full-text search across all mappings |
get_columns |
List columns for a specific table |
search_graylog |
Query Graylog logs via Lucene syntax |
list_graylog_streams |
List available Graylog streams |
search_elasticsearch |
Execute Elasticsearch DSL queries |
health_check |
Validate Oracle, Graylog, and ES connections |
pip install -e .
# With Elasticsearch support:
pip install -e ".[elasticsearch]"
# With dev dependencies (pytest):
pip install -e ".[dev]"Copy .env.example to .env and fill in your credentials:
cp .env.example .envRequired environment variables:
# Oracle (single connection shared by all 27 schemas)
ORACLE_SAE_CONN=user/password@host:1521/service_name
# Graylog
GRAYLOG_API_URL=https://logs.example.com/api
GRAYLOG_API_TOKEN=your_token
# Elasticsearch
ES_HOST=http://elastic.example.com:9200
ES_USER=admin
ES_PASS=your_password
ES_INDEX=atuacapespython -m mcp_unified_dbCopy .mcp.json.example to .mcp.json and update with your credentials.
All schemas share the same connection and support unlimited cross-schema JOINs:
AVAL_PROPOSTA, CAPES, CAPES_GLOBAL, CONSPRE, CORPORATIVO, EDITAL, EDUCAPES,
EVENTOS, FINANCEIRO, INSCRICAO, PDTIC, PPG_AVALIACAO, PPG_ONLINE, PREMIO,
PREMIOCAPES, PREMIO_CAPES, PREMIO_DEFESA, PREMIO_FAMILIA, PREMIO_MINFRA,
PREMIO_VOLKSWAGEN, RABLISTENER, SAE, SCBA, SIPREC, SISCAD,
SUCUPIRA_PAINEL, WEB_MEUSDADOS
SODA_CONSPRE- Collections: CERTIFICADOS, INSCRICOES, INSCRICOES_2, ORCID- Access via cross-schema:
SELECT * FROM SODA_CONSPRE.INSCRICOES
1. find_table('PAGAMENTO') # Find which schema has the table
2. get_columns('FINANCEIRO', 'PAGAMENTO') # List available columns
3. execute_sql(database='FINANCEIRO', sql='...') # Execute query with confidence
SELECT p.NM_PESSOA, pe.VL_PAGAMENTO
FROM SAE.PESSOA_EVENTO pe
JOIN CORPORATIVO.PESSOA p ON pe.ID_PESSOA = p.ID_PESSOA
FETCH NEXT 100 ROWS ONLY{
"size": 0,
"aggs": {
"by_type": { "terms": { "field": "atuacoes.tipo.keyword" } }
}
}level:error AND app:conspre AND message:*timeout*
mcp-unified-db/
├── pyproject.toml
├── src/mcp_unified_db/
│ ├── server.py # FastMCP server (tools)
│ ├── instructions.py # MCP instructions string
│ ├── config.py # Environment configuration
│ ├── core/
│ │ ├── validators.py # SQL validation
│ │ ├── formatters.py # Output formatting
│ │ └── schema.py # Schema loader/cache
│ ├── executors/
│ │ ├── oracle.py # Oracle connection pool
│ │ ├── elasticsearch.py # Elasticsearch DSL
│ │ └── graylog.py # Graylog Lucene
│ └── cli/
│ ├── import_schema.py # Import Oracle schema
│ ├── import_soda.py # Import SODA collections
│ ├── generate_mappings.py # Batch mapping generator
│ └── report.py # Institutional/integrated reports
├── data/schema_mappings/ # Schema mapping files (~820KB)
├── tests/
└── docs/
# Import a new schema
python -m mcp_unified_db.cli.import_schema SCHEMA_NAME "Description"
# Import SODA collections
python -m mcp_unified_db.cli.import_soda
# Regenerate all mappings
python -m mcp_unified_db.cli.generate_mappings
# Generate reports
python -m mcp_unified_db.cli.report institutional
python -m mcp_unified_db.cli.report integratedpip install -e ".[dev]"
pytest tests/ -vpytest tests/ -v
python -m py_compile src/mcp_unified_db/server.py