For AI Agents
Claude Code
MCP server integration for Claude Code and other MCP-compatible agents.
Install MCP Server
bash
npm install -g @astapa/mcp-serverConfigure Claude Code
Add to your MCP settings:
json
{
"mcpServers": {
"astapa": {
"command": "astapa-mcp",
"args": ["--api-url", "http://localhost:8080"],
"env": {
"DATABASE_URL": "postgres://user:pass@localhost:5433/mydb"
}
}
}
}Available Tools
astapa_query
Execute SELECT queries against production data
astapa_mutate
Execute INSERT/UPDATE/DELETE - staged for review
astapa_diff
View pending changes in current session
astapa_propose
Submit changes for human review
Usage
Once configured, Claude Code can:
text
You: "Find all users who haven't logged in for 30 days and mark them inactive"
Claude: I'll query for inactive users and update their status.
[astapa_query] SELECT id, email FROM users WHERE last_login < NOW() - INTERVAL '30 days'
→ Found 42 users
[astapa_mutate] UPDATE users SET status = 'inactive' WHERE last_login < NOW() - INTERVAL '30 days'
→ Staged 42 updates
[astapa_diff]
→ users: 42 rows modified (status: active → inactive)
I've staged the changes. Run astapa_propose when ready for review.Approve via CLI
bash
# List pending sessions
astapa sessions --status proposed
# Review diff
astapa diff sess_abc123
# Approve
astapa approve sess_abc123