Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 24 additions & 53 deletions .cursor/rules/801-feature-workflow.mdc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
description: FOLLOW feature development workflow WHEN implementing new features TO ensure consistent, tested, and documented changes
globs: src/**/*.{ts,tsx}
alwaysApply: true
---

# Feature Development Workflow
Expand All @@ -14,71 +15,41 @@ globs: src/**/*.{ts,tsx}
- Start from up-to-date main branch
- Create feature branch with descriptive name (feature/feature-name)
- Locate and review feature documentation in docs/features directory
- Follow implementation in small, focused chunks:
1. Add types and interfaces first
2. Add client methods next
3. Add MCP server tools
4. Add tests for each component
5. Update documentation for completed items
- Commit after EACH of these changes:
- New types/interfaces
- New client methods
- New MCP tools
- New tests
- Documentation updates
- Linting/formatting fixes
- Push to remote after each significant commit to:
- Back up your work
- Enable early feedback
- Make PRs easier to review
- Use conventional commit messages:
- feat: new feature
- fix: bug fix
- docs: documentation changes
- test: adding tests
- refactor: code changes that neither fix bugs nor add features
- style: formatting, missing semi colons, etc
- chore: updating build tasks, package manager configs, etc
- Follow documentation requirements systematically
- Commit frequently to trigger pre-commit hooks (linting, formatting, tests)
- Add comprehensive tests for new functionality
- Push completed work to remote for PR review

## Examples
<example>
# Good workflow
1. git checkout main && git pull
2. git checkout -b feature/project-management
3. Review docs/features/003-project-management.md
4. Add Project and Environment types
5. Commit: "feat: add Project and Environment types"
6. Push: git push -u origin feature/project-management
7. Add client methods for projects
8. Commit: "feat: add project-related methods to CoolifyClient"
9. Push: git push
10. Add MCP server tools
11. Commit: "feat: add project management tools to MCP server"
12. Push: git push
13. Add tests
14. Commit: "test: add project management tests"
15. Push: git push
16. Update feature doc for completed items
17. Commit: "docs: update feature doc for project management"
18. Push: git push
2. git checkout -b feature/server-info
3. Review docs/features/002-server-info-resource.md
4. Implement ServerInfo interface
5. Add getServerInfo method with tests
6. Commit to run hooks: "feat: add server info interface"
7. Implement ServerStatus interface
8. Add getServerStatus method with tests
9. Commit to run hooks: "feat: add server status resource"
10. Fix any linting issues
11. Push to remote when complete
</example>

<example type="invalid">
# Poor workflow
1. Make all changes at once (types, client, server, tests)
2. Single large commit with all changes
3. No documentation updates until the end
1. Start coding without checking docs
2. Make all changes in one big commit
3. Skip tests or add them later
4. Push directly to main
5. No intermediate pushes to remote
6. Vague commit messages like "project management work"
5. Fix linting issues after PR
</example>

## Critical Points
<critical>
- NEVER make large, multi-component changes in a single commit
- ALWAYS commit after each logical component change
- ALWAYS push to remote after significant commits
- ALWAYS update documentation AS YOU GO
- ALWAYS use conventional commit messages
- NEVER wait until the end to write tests
- ALWAYS work from feature documentation
-
- NEVER skip tests for new functionality
- Commit OFTEN to utilize pre-commit hooks
- Keep commits focused and well-described
</critical>
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ node_modules/
# Build output
dist/
build/
lib/
/lib/
coverage/

# IDE and editor files
Expand Down
205 changes: 171 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A Model Context Protocol (MCP) server implementation for [Coolify](https://cooli
"coolify": {
"command": "npx",
"args": [
"-y", "@stumason/coolify-mcp"
"-y", "@masonator/coolify-mcp"
],
"env": {
"COOLIFY_ACCESS_TOKEN": "0|your-secret-token",
Expand All @@ -30,9 +30,9 @@ command:
This MCP server provides a standardized interface for AI models to:

- Query Coolify server information
- Manage deployments
- Handle database operations
- Monitor resources
- Manage projects and environments
- Handle deployments and resources
- Monitor server status
- And more...

By implementing the [Model Context Protocol](https://modelcontextprotocol.io), this server allows AI assistants to understand and interact with your Coolify infrastructure in a secure and controlled manner.
Expand Down Expand Up @@ -66,19 +66,178 @@ COOLIFY_ACCESS_TOKEN=your_access_token_here
COOLIFY_BASE_URL=https://your.coolify.instance
```

## Usage
## Available Tools

### Starting the Server
### Server Management

```bash
# Build and start the server
npm run build
npm start
#### list_servers

Lists all Coolify servers in your instance.

```typescript
// Returns: ServerInfo[]
await client.list_servers();
```

The server will start in stdio mode, allowing it to communicate with MCP clients through standard input/output.
#### get_server

### Development
Get detailed information about a specific server.

```typescript
// Returns: ServerInfo
await client.get_server(uuid: string)
```

#### get_server_resources

Get current resources (applications, databases, etc.) running on a server.

```typescript
// Returns: ServerResources[]
await client.get_server_resources(uuid: string)
```

#### get_server_domains

Get domains associated with a server.

```typescript
// Returns: ServerDomain[]
await client.get_server_domains(uuid: string)
```

#### validate_server

Validate the connection to a specific server.

```typescript
// Returns: ValidationResponse
await client.validate_server(uuid: string)
```

### Project Management

#### list_projects

List all projects in your Coolify instance.

```typescript
// Returns: Project[]
await client.list_projects();
```

#### get_project

Get detailed information about a specific project.

```typescript
// Returns: Project
await client.get_project(uuid: string)
```

#### create_project

Create a new project.

```typescript
// Returns: { uuid: string }
await client.create_project({
name: string,
description?: string
})
```

#### update_project

Update an existing project's details.

```typescript
// Returns: Project
await client.update_project(uuid: string, {
name?: string,
description?: string
})
```

#### delete_project

Delete a project.

```typescript
// Returns: { message: string }
await client.delete_project(uuid: string)
```

### Environment Management

#### getProjectEnvironment

Get an environment within a project. This is the only supported method for environment operations.

```typescript
// Returns: Environment
await client.getProjectEnvironment(
project_uuid: string,
environment_name_or_uuid: string
)
```

Example:

```typescript
const environment = await client.getProjectEnvironment(
'ikokwc8sk00wk8sg8gkwoscw', // Project UUID
'production', // Environment name or UUID
);
```

Note: Environment operations are only available through the project endpoints. There are no standalone environment endpoints.

## Type Definitions

### ServerInfo

```typescript
interface ServerInfo {
uuid: string;
name: string;
status: 'running' | 'stopped' | 'error';
version: string;
resources: {
cpu: number;
memory: number;
disk: number;
};
}
```

### Environment

```typescript
interface Environment {
id: number;
uuid: string;
name: string;
project_uuid: string;
variables?: Record<string, string>;
created_at: string;
updated_at: string;
}
```

### Project

```typescript
interface Project {
id: number;
uuid: string;
name: string;
description?: string;
environments?: Environment[];
}
```

## Development

```bash
# Run in development mode
Expand Down Expand Up @@ -153,16 +312,6 @@ src/
- Update documentation as needed
- Follow the established code style

## Testing

The project uses Jest for testing. Tests are located in `src/__tests__/` and can be run with `npm test`.

### Test Structure

- Unit tests for individual components
- Integration tests for API interactions
- Mock implementations for external services

## CI/CD

GitHub Actions workflows are configured to:
Expand All @@ -172,18 +321,6 @@ GitHub Actions workflows are configured to:
- Verify build process
- Run linting checks

## API Documentation

### Available Resources

1. Server Information
```typescript
// Get server info
coolify://server/info
```

More resources will be documented as they are implemented.

## License

MIT
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@stumason/coolify-mcp",
"name": "@masonator/coolify-mcp",
"scope": "@masonator",
"version": "0.1.0",
"description": "MCP server implementation for Coolify",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"bin": {
"coolify-mcp": "./dist/index.js"
"coolify-mcp": "dist/index.js"
},
"files": [
"dist"
Expand Down
Loading