A Model Context Protocol (MCP) server that provides read-only access to Cardano governance data via PostgreSQL.
This MCP server enables AI assistants like Claude to query Cardano governance data including:
- DReps (Delegated Representatives) - voting power, profiles
- Proposals - governance actions, status, vote tallies
- Votes - on-chain voting records with rationale URLs
- SPOs (Stake Pool Operators) and CC (Constitutional Committee) members
npm install
npm run buildCopy .env.example to .env and configure:
# Database
DB_HOST=localhost
DB_PORT=5432
DB_NAME=cgov
DB_USER=postgres
DB_PASSWORD=postgres
# Server
TRANSPORT_MODE=http # or "stdio" for Claude Desktop
PORT=3000
HOST=0.0.0.0npm startThe server runs on http://localhost:3000 with endpoints:
POST /mcp- MCP protocol endpointGET /health- Health check
With the server running, add to your Claude Desktop config:
{
"mcpServers": {
"cgov-mcp": {
"type": "http",
"url": "http://localhost:3000/mcp"
}
}
}Use this if you want Claude Desktop to spawn and manage the server process directly (no separate npm start needed).
Set TRANSPORT_MODE=stdio in .env, then configure Claude Desktop:
{
"mcpServers": {
"cgov-mcp": {
"command": "node",
"args": ["/path/to/cgov-mcp/dist/index.js"],
"env": {
"TRANSPORT_MODE": "stdio",
"DB_HOST": "localhost",
"DB_NAME": "cgov",
"DB_USER": "postgres",
"DB_PASSWORD": "postgres"
}
}
}
}| Tool | Description |
|---|---|
query_database |
Execute read-only SQL queries |
list_tables |
List all database tables |
describe_table |
Get table schema/structure |
search_constitution |
Search the Cardano Constitution for relevant text |
get_constitution_section |
Get a specific section of the Constitution by name |
search_vision_2030 |
Search the Cardano Vision 2030 Strategic Framework |
get_vision_section |
Get a specific section of the Vision 2030 document |
get_vision_kpis |
Get Vision 2030 KPIs and targets |
search_voting_rationale |
Search voting rationales by keywords |
get_vote_rationale |
Get full rationale for a specific vote |
get_drep_voting_history |
Get DRep voting history with rationales |
get_proposal_rationales |
Get all rationales for a specific proposal |
get_rationale_stats |
Get statistics on rationale coverage |
The voting rationale tools provide access to on-chain voting data with CIP-100/CIP-136 structured rationales:
# Search for rationales containing specific keywords
search_voting_rationale(query="constitutional")
# Filter by vote type and voter type
search_voting_rationale(query="treasury", vote_filter="NO", voter_type="DREP")
# Get full rationale for a specific vote
get_vote_rationale(vote_id="abc123...")
# Get rationale by DRep + proposal combination
get_vote_rationale(drep_id="drep1...", proposal_id="gov_action1...")
# Get a DRep's voting history with rationales
get_drep_voting_history(drep_id="drep1...")
# Filter by governance action type
get_drep_voting_history(drep_id="drep1...", governance_action_type="TREASURY_WITHDRAWALS")
# Get all rationales for a proposal grouped by vote choice
get_proposal_rationales(proposal_id="gov_action1...")
# Get rationale coverage statistics
get_rationale_stats()
get_rationale_stats(governance_action_type="INFO_ACTION")
Rationales are stored in CIP-100/CIP-136 JSON format containing:
body.summary- Brief summary of the vote reasoningbody.rationaleStatement- Detailed rationalebody.conclusion- Final conclusionbody.precedentDiscussion- Discussion of relevant precedentsbody.counterargumentDiscussion- Acknowledgment of counterargumentsbody.internalVote- Internal vote breakdown (for CC votes)body.references- Links to relevant articles and documentsauthors- Who authored the rationale
The Cardano Vision 2030 Strategic Framework outlines the path to making Cardano "The World's Operating System":
# Search for specific topics
search_vision_2030(query="TVL target")
# Get a specific pillar
get_vision_section(section_name="Pillar 3")
# Get all KPIs
get_vision_kpis()
# Filter KPIs by category
get_vision_kpis(category="Governance")
# Search within a specific pillar
search_vision_2030(query="DeFi", pillar="Adoption")
The Cardano Constitution contains governance rules, tenets, and guardrails. Use the constitution tools to search and retrieve specific provisions:
# Search for treasury-related provisions
search_constitution(query="treasury withdrawal")
# Get a specific article
get_constitution_section(section_name="Article VII")
# Find a specific tenet
get_constitution_section(section_name="Tenet 5")
# Look up a guardrail code
get_constitution_section(section_name="TREASURY-01a")
# Search with full section output
search_constitution(query="DRep voting threshold", include_full_sections=true)
-- Get top 10 DReps by voting power
SELECT name, "votingPower" FROM "Drep" ORDER BY "votingPower" DESC LIMIT 10;
-- Get voting history for a DRep
SELECT v.vote, p.title, p."governanceActionType"
FROM "OnchainVote" v
JOIN "Proposal" p ON v."proposalId" = p."proposalId"
WHERE v."drepId" = 'drep1...'
ORDER BY v."votedAt" DESC;
-- Get vote distribution summary
SELECT vote, COUNT(*) FROM "OnchainVote" GROUP BY vote;Drep- DRep profiles and voting powerProposal- Governance proposals and metadataOnchainVote- Voting records with rationale URLsSPO- Stake pool operatorsCC- Constitutional committee members
npm run dev # Watch mode for TypeScript
npm run build # Compile TypeScript
npm run clean # Remove dist folderApache-2.0