Skip to content

Commit 84f76f8

Browse files
authored
Merge pull request #3 from incident-io/chris/post-migration-tidy-up
Prepare repository for public use
2 parents 50af23f + 17109c6 commit 84f76f8

29 files changed

+340
-371
lines changed

.claude/settings.local.json

Lines changed: 0 additions & 66 deletions
This file was deleted.

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
INCIDENT_IO_API_KEY=your_api_key_here
66

77
# Optional: Custom incident.io endpoint
8-
# INCIDENTIO_ENDPOINT=https://api.incident.io
8+
# INCIDENT_IO_BASE_URL=https://api.incident.io/v2

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,7 @@ Thumbs.db
3131

3232
# Environment
3333
.env
34-
*.env
34+
*.env
35+
36+
# Claude Code settings
37+
.claude/settings.local.json

CONFIGURATION.md

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
# Configuration Guide
2+
3+
This document covers environment variables, server configuration, and deployment options for the incident.io MCP server.
4+
5+
## Environment Variables
6+
7+
### Required
8+
9+
- **`INCIDENT_IO_API_KEY`** - Your incident.io API key for authentication
10+
- Obtain from your incident.io account settings
11+
- Required for all API operations
12+
13+
### Optional
14+
15+
- **`INCIDENT_IO_BASE_URL`** - Base URL for incident.io API
16+
- Default: `https://api.incident.io/v2`
17+
- Only change if using a different incident.io instance
18+
19+
## Configuration Files
20+
21+
### `.env` File
22+
23+
Create a `.env` file in the project root for local development:
24+
25+
```bash
26+
# Copy from example
27+
cp .env.example .env
28+
29+
# Edit with your values
30+
INCIDENT_IO_API_KEY=your_api_key_here
31+
# INCIDENT_IO_BASE_URL=https://api.incident.io/v2 # Optional
32+
```
33+
34+
## MCP Client Configuration
35+
36+
### Claude Desktop
37+
38+
Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json`):
39+
40+
```json
41+
{
42+
"mcpServers": {
43+
"incident-io": {
44+
"command": "/path/to/your/project/start-mcp-server.sh",
45+
"env": {
46+
"INCIDENT_IO_API_KEY": "your_api_key_here"
47+
}
48+
}
49+
}
50+
}
51+
```
52+
53+
### Other MCP Clients
54+
55+
For other MCP clients, configure them to:
56+
57+
1. Execute the `start-mcp-server.sh` script
58+
2. Set the `INCIDENT_IO_API_KEY` environment variable
59+
3. Optionally set `INCIDENT_IO_BASE_URL` if needed
60+
61+
## Server Options
62+
63+
### Standard Server
64+
65+
```bash
66+
./start-mcp-server.sh
67+
```
68+
69+
- Minimal startup validation
70+
- Graceful handling of missing API key
71+
72+
### Validated Server
73+
74+
```bash
75+
./start-with-env.sh
76+
```
77+
78+
- Validates API key is set before starting
79+
- Auto-builds server if binary is missing
80+
- Exits with error if API key is missing
81+
82+
## Deployment Considerations
83+
84+
### Docker
85+
86+
If deploying with Docker, ensure environment variables are passed:
87+
88+
```dockerfile
89+
ENV INCIDENT_IO_API_KEY=${INCIDENT_IO_API_KEY}
90+
```
91+
92+
### System Service
93+
94+
When running as a system service, ensure:
95+
96+
1. Environment variables are properly set
97+
2. Working directory is set to the project root
98+
3. Binary has appropriate permissions
99+
100+
### Security Notes
101+
102+
- **Never commit API keys to version control**
103+
- Use environment variables or secure secret management
104+
- Restrict file permissions on configuration files containing secrets
105+
- Consider using dedicated service accounts with minimal required permissions
106+
107+
## API Rate Limits
108+
109+
The incident.io API has rate limits. The server handles these gracefully, but be aware:
110+
111+
- Plan API usage according to your incident.io plan limits
112+
- Consider caching strategies for frequently accessed data
113+
- Monitor API usage through incident.io dashboard
114+
115+
## Troubleshooting Configuration
116+
117+
### Missing API Key
118+
119+
```
120+
Error: INCIDENT_IO_API_KEY environment variable is not set
121+
```
122+
123+
**Solution**: Set the API key in your `.env` file or environment
124+
125+
### Invalid API Key
126+
127+
```
128+
Authentication failed
129+
```
130+
131+
**Solution**: Verify your API key is correct and has necessary permissions
132+
133+
### Connection Issues
134+
135+
```
136+
Failed to connect to incident.io API
137+
```
138+
139+
**Solutions**:
140+
141+
- Check network connectivity
142+
- Verify `INCIDENT_IO_BASE_URL` if using custom endpoint
143+
- Check firewall settings

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ git clone https://github.com/your-username/incidentio-mcp-golang.git
5555
cd incidentio-mcp-golang
5656

5757
# Add upstream remote
58-
git remote add upstream https://github.com/twentworth12/incidentio-mcp-golang.git
58+
git remote add upstream https://github.com/incident-io/incidentio-mcp-golang.git
5959

6060
# Install dependencies
6161
go mod download

DEPLOYMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
### 1. Clone and Build
1212

1313
```bash
14-
git clone https://github.com/tomwentworth/incidentio-mcp-golang.git
14+
git clone https://github.com/incident-io/incidentio-mcp-golang.git
1515
cd incidentio-mcp-golang
1616
go build -o bin/mcp-server ./cmd/mcp-server
1717
```

DEVELOPMENT.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Development Guide
2+
3+
This document covers development setup, testing, and contribution guidelines for the incident.io MCP server.
4+
5+
## Prerequisites
6+
7+
- Go 1.21 or higher
8+
- Access to incident.io API (for testing)
9+
10+
## Setup
11+
12+
1. Clone the repository
13+
2. Copy `.env.example` to `.env` and configure your API key:
14+
```bash
15+
cp .env.example .env
16+
# Edit .env and add your INCIDENT_IO_API_KEY
17+
```
18+
19+
## Building
20+
21+
Build the MCP server:
22+
```bash
23+
go build -o bin/mcp-server ./cmd/mcp-server
24+
```
25+
26+
## Running
27+
28+
### Quick Start
29+
```bash
30+
./start-mcp-server.sh
31+
```
32+
33+
### With Environment Validation
34+
```bash
35+
./start-with-env.sh
36+
```
37+
38+
This script will:
39+
- Load environment variables from `.env`
40+
- Validate that required API keys are set
41+
- Build the server if needed
42+
- Start the MCP server
43+
44+
### Testing API Connection
45+
```bash
46+
./tests/test_api.sh
47+
```
48+
49+
## Testing
50+
51+
### Unit Tests
52+
```bash
53+
# Run all tests
54+
go test ./...
55+
56+
# Run specific package tests
57+
go test ./internal/incidentio/...
58+
59+
# Run tests with verbose output
60+
go test -v ./...
61+
```
62+
63+
### Integration Tests
64+
```bash
65+
# Test API endpoints
66+
./tests/test_endpoints.sh
67+
```
68+
69+
## Code Quality
70+
71+
### Formatting
72+
```bash
73+
go fmt ./...
74+
```
75+
76+
### Linting
77+
```bash
78+
# If golangci-lint is available
79+
golangci-lint run
80+
```
81+
82+
## Project Structure
83+
84+
- `/cmd/` - Entry points for different server configurations
85+
- `/internal/incidentio/` - incident.io API client implementation
86+
- `/internal/tools/` - MCP tool implementations
87+
- `/internal/server/` - MCP server logic
88+
- `/tests/` - Integration test scripts
89+
90+
## Development Standards
91+
92+
- Use Go 1.21+ features and idioms
93+
- Follow standard Go formatting (gofmt)
94+
- Use meaningful variable and function names
95+
- Handle errors explicitly, don't ignore them
96+
- Write tests for new functionality
97+
- Update documentation for API changes
98+
99+
## Contributing
100+
101+
1. Fork the repository
102+
2. Create a feature branch
103+
3. Make your changes following the development standards
104+
4. Add tests for new functionality
105+
5. Run the full test suite
106+
6. Submit a pull request
107+
108+
## Debugging
109+
110+
For debugging issues:
111+
1. Check that your API key is correctly set
112+
2. Verify API connectivity with `./tests/test_api.sh`
113+
3. Check server logs for detailed error messages
114+
4. Use Go's built-in debugging tools for development

0 commit comments

Comments
 (0)