A GoLang implementation of an MCP (Model Context Protocol) server for incident.io, providing tools to interact with the incident.io V2 API.
# Clone the repository
git clone https://github.com/twentworth12/incidentio-mcp-golang.git
cd incidentio-mcp-golang
# Copy environment variables
cp .env.example .env
# Edit .env and add your incident.io API key
# Build and run
make build
./start-mcp-server.sh- β Complete incident.io V2 API coverage
- β Workflow automation and management
- β Alert routing and event handling
- β Comprehensive test suite
- β MCP protocol compliant
- β Clean, modular architecture
.
βββ cmd/mcp-server/ # Main application entry point
βββ internal/ # Private application code
β βββ server/ # MCP server implementation
β βββ tools/ # Tool implementations
βββ pkg/mcp/ # MCP protocol types and utilities
βββ go.mod # Go module definition
βββ go.sum # Go module checksums
βββ Makefile # Build commands
- Go 1.21 or higher
- incident.io API key (set as
INCIDENT_IO_API_KEYenvironment variable)
- Clone the repository
- Install dependencies:
make deps
make buildThis will create a binary in the bin/ directory.
Set your incident.io API key:
export INCIDENT_IO_API_KEY=your-api-keyThen run the server:
make runOr after building:
./bin/mcp-servermake test- Create a new file in
internal/tools/implementing theToolinterface - Register the tool in
server.registerTools()method ininternal/server/server.go
Example tool implementation:
type MyTool struct{}
func (t *MyTool) Name() string {
return "my_tool"
}
func (t *MyTool) Description() string {
return "Description of what the tool does"
}
func (t *MyTool) InputSchema() map[string]interface{} {
return map[string]interface{}{
"type": "object",
"properties": map[string]interface{}{
// Define your parameters here
},
"required": []string{/* required parameters */},
}
}
func (t *MyTool) Execute(args map[string]interface{}) (string, error) {
// Tool implementation
return "result", nil
}list_incidents- List incidents with optional filters (status, severity)get_incident- Get details of a specific incident by IDcreate_incident- Create a new incidentupdate_incident- Update an existing incidentclose_incident- Close an incident with proper workflow handlinglist_incident_statuses- List available incident statuseslist_incident_types- List available incident types
list_incident_updates- List incident status updates/messagesget_incident_update- Get a specific incident updatecreate_incident_update- Post a new status update to an incidentdelete_incident_update- Delete an incident update
list_severities- List available severity levelsget_severity- Get details of a specific severity
list_alerts- List alerts with optional filtersget_alert- Get details of a specific alert by IDlist_alerts_for_incident- List alerts associated with a specific incidentlist_alert_sources- List available alert sourcescreate_alert_event- Create an alert event
list_alert_routes- List alert routes with optional paginationget_alert_route- Get details of a specific alert routecreate_alert_route- Create a new alert route with conditions and escalationsupdate_alert_route- Update an alert route's configuration
list_workflows- List workflows with optional paginationget_workflow- Get details of a specific workflowupdate_workflow- Update a workflow's configuration
list_actions- List actions with optional filters (incident_id, status)get_action- Get details of a specific action by ID
list_available_incident_roles- List available incident roleslist_users- List users in the organizationassign_incident_role- Assign a role to a user for an incident
example_tool- A simple echo tool for testing
This server implements the Model Context Protocol (MCP) for communication with AI assistants. The server:
- Communicates via JSON-RPC over stdin/stdout
- Supports tool registration and execution
- Follows the MCP 2024-11-05 protocol version
- Integrates with incident.io V2 API endpoints
Add to your Claude configuration:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"incidentio": {
"command": "/path/to/incidentio-mcp-golang/bin/mcp-server-clean",
"env": {
"INCIDENT_IO_API_KEY": "your-api-key"
}
}
}
}After updating the configuration, restart Claude to load the incident.io tools.
INCIDENT_IO_API_KEY(required) - Your incident.io API keyINCIDENT_IO_BASE_URL(optional) - Override the API base URL (defaults to https://api.incident.io/v2)
# Run unit tests
make test-unit
# Run integration tests (requires API key)
make test-integration
# Run all tests
make testSee TESTING.md for detailed testing documentation.
- 404 errors: Ensure incident IDs are valid and exist in your instance
- Authentication errors: Verify your API key is correct and has proper permissions
- Parameter errors: All incident-related tools use
incident_idas the parameter name - Status transition errors: Some incident status changes require specific workflows (e.g., must be in "Monitoring" before "Closed")
- Page size errors: Different endpoints have different limits (incidents: 250, alerts: 50)
To enable debug logging, use the wrapper script:
# Create wrapper script
cat > mcp-debug-wrapper.sh << 'EOF'
#!/bin/bash
LOG_FILE="/tmp/mcp-incidentio-debug-$(date +%Y%m%d).log"
exec /path/to/bin/mcp-server-clean 2>>"$LOG_FILE"
EOF
chmod +x mcp-debug-wrapper.shThen use the wrapper in your Claude configuration to capture debug logs.
Contributions are welcome! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with the Model Context Protocol specification
- Powered by incident.io API
- Created with assistance from Claude