这是indexloc提供的服务,不要输入任何密码
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
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
pull_request:
branches: [ main, develop ]

permissions:
contents: read
issues: write
pull-requests: write

env:
# Define the primary Node.js version for release, build, coverage uploads and badge generation
PRIMARY_NODE_VERSION: '22.x'
Expand Down
8 changes: 0 additions & 8 deletions upsun-mcp/src/command/backup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ export function registerBackup(adapter: McpAdapter): void {
* The backup includes all data, code, and configuration for the environment.
* Backups can be used for disaster recovery or environment cloning.
*
* @todo Implementation is pending
*
* @param project_id - The project ID containing the environment
* @param environment_name - The name of the environment to backup
* @param is_live - Whether to create a backup of the live environment (default: true)
Expand Down Expand Up @@ -78,8 +76,6 @@ export function registerBackup(adapter: McpAdapter): void {
* @warning This operation is irreversible and will permanently remove
* the backup and its data.
*
* @todo Implementation is pending
*
* @param project_id - The project ID containing the environment
* @param environment_name - The name of the environment
* @param backup_id - The unique identifier of the backup to delete
Expand Down Expand Up @@ -111,8 +107,6 @@ export function registerBackup(adapter: McpAdapter): void {
* Returns comprehensive backup details including creation time,
* size, status, and associated metadata.
*
* @todo Implementation is pending
*
* @param project_id - The project ID containing the environment
* @param environment_name - The name of the environment
* @param backup_id - The unique identifier of the backup
Expand Down Expand Up @@ -142,8 +136,6 @@ export function registerBackup(adapter: McpAdapter): void {
* Returns an array of backups with basic information such as
* backup ID, creation time, size, and status.
*
* @todo Implementation is pending
*
* @param project_id - The project ID containing the environment
* @param environment_name - The name of the environment
*/
Expand Down
21 changes: 5 additions & 16 deletions upsun-mcp/src/command/certificate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ const log = createLogger('MCP:Tool:certificate-commands');
* - get-certificate: Retrieves information about a specific certificate
* - list-certificate: Lists all certificates for a project
*
* @note Many of these tools are currently marked as "TODO" and will return
* placeholder responses until implementation is complete.
*
* @param adapter - The MCP adapter instance to register tools with
*
* @example
Expand All @@ -45,8 +42,6 @@ export function registerCertificate(adapter: McpAdapter): void {
* Let's Encrypt certificates, for cases where wildcard certificates or
* Extended Validation (EV) certificates are required.
*
* @todo Implementation is pending
*
* @param project_id - The project ID to add the certificate to
* @param certificate - The public certificate in PEM format
* @param key - The private key in PEM format
Expand All @@ -60,11 +55,11 @@ export function registerCertificate(adapter: McpAdapter): void {
project_id: Schema.projectId(),
certificate: z.string(),
key: z.string(),
chain: z.string(),
chain: z.any(),
},
async ({ project_id, certificate, key, chain }) => {
log.debug(`Add Certificate in Project ${project_id}`);
const result = 'TODO'; //await adapter.client.certificate.add(project_id, certificate, key, chain);
const result = await adapter.client.certificate.add(project_id, certificate, key, chain);

return Response.json(result);
}
Expand All @@ -78,8 +73,6 @@ export function registerCertificate(adapter: McpAdapter): void {
* @warning This operation is irreversible and may impact HTTPS access
* to domains associated with this certificate.
*
* @todo Implementation is pending
*
* @param project_id - The project ID containing the certificate
* @param certificate_id - The unique identifier of the certificate to delete
*/
Expand All @@ -93,7 +86,7 @@ export function registerCertificate(adapter: McpAdapter): void {
},
async ({ project_id, certificate_id }) => {
log.debug(`Delete Certificate ${certificate_id} in Project ${project_id}`);
const result = 'TODO'; //await adapter.client.certificate.delete(project_id, certificate_id);
const result = await adapter.client.certificate.delete(project_id, certificate_id);

return Response.json(result);
}
Expand All @@ -107,8 +100,6 @@ export function registerCertificate(adapter: McpAdapter): void {
* Returns comprehensive certificate details including validity dates,
* domains covered, issuer information, and current status.
*
* @todo Implementation is pending
*
* @param project_id - The project ID containing the certificate
* @param certificate_id - The unique identifier of the certificate
*/
Expand All @@ -121,7 +112,7 @@ export function registerCertificate(adapter: McpAdapter): void {
},
async ({ project_id, certificate_id }) => {
log.debug(`Get Certificate ${certificate_id} in Project ${project_id}`);
const result = 'TODO'; //await adapter.client.certificate.get(project_id, certificate_id);
const result = await adapter.client.certificate.get(project_id, certificate_id);

return Response.json(result);
}
Expand All @@ -134,8 +125,6 @@ export function registerCertificate(adapter: McpAdapter): void {
* Returns an array of certificates with basic information such as
* certificate ID, domains covered, validity dates, and status.
*
* @todo Implementation is pending
*
* @param project_id - The project ID to list certificates from
*/
adapter.server.tool(
Expand All @@ -146,7 +135,7 @@ export function registerCertificate(adapter: McpAdapter): void {
},
async ({ project_id }) => {
log.debug(`List Certificates in Project ${project_id}`);
const result = 'TODO'; //await adapter.client.certificate.list(project_id);
const result = await adapter.client.certificate.list(project_id);

return Response.json(result);
}
Expand Down
23 changes: 5 additions & 18 deletions upsun-mcp/src/command/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ const log = createLogger('MCP:Tool:domain-commands');
* - list-domain: Lists all domains for a project
* - update-domain: Updates configuration for an existing domain
*
* @note Many of these tools are currently marked as "TODO" and will return
* placeholder responses until implementation is complete.
*
* @param adapter - The MCP adapter instance to register tools with
*
* @example
Expand All @@ -46,8 +43,6 @@ export function registerDomain(adapter: McpAdapter): void {
* processes to secure the domain with HTTPS. The domain owner must configure
* the appropriate DNS records to point to Upsun.
*
* @todo Implementation is pending
*
* @param project_id - The project ID to add the domain to
* @param domain_name - The domain name to add (e.g., example.com)
*/
Expand All @@ -61,7 +56,7 @@ export function registerDomain(adapter: McpAdapter): void {
},
async ({ project_id, domain_name }) => {
log.debug(`Add Domain ${domain_name} to Project ${project_id}`);
const result = 'TODO'; //await adapter.client.domain.add(project_id, domain_name);
const result = await adapter.client.domain.add(project_id, domain_name);

return Response.json(result);
}
Expand All @@ -75,8 +70,6 @@ export function registerDomain(adapter: McpAdapter): void {
* @warning This operation will make the project inaccessible via this domain.
* Any certificates associated with this domain will also be removed.
*
* @todo Implementation is pending
*
* @param project_id - The project ID containing the domain
* @param domain_name - The domain name to remove
*/
Expand All @@ -90,7 +83,7 @@ export function registerDomain(adapter: McpAdapter): void {
},
async ({ project_id, domain_name }) => {
log.debug(`Delete Domain ${domain_name} from Project ${project_id}`);
const result = 'TODO'; //await adapter.client.domain.delete(project_id, domain_name);
const result = await adapter.client.domain.delete(project_id, domain_name);

return Response.json(result);
}
Expand All @@ -104,8 +97,6 @@ export function registerDomain(adapter: McpAdapter): void {
* Returns comprehensive domain details including status, SSL configuration,
* DNS validation status, and associated environments.
*
* @todo Implementation is pending
*
* @param project_id - The project ID containing the domain
* @param domain_name - The domain name to query
*/
Expand All @@ -118,7 +109,7 @@ export function registerDomain(adapter: McpAdapter): void {
},
async ({ project_id, domain_name }) => {
log.debug(`Get Domain ${domain_name} in Project ${project_id}`);
const result = 'TODO'; //await adapter.client.domain.get(project_id, domain_name);
const result = await adapter.client.domain.get(project_id, domain_name);

return Response.json(result);
}
Expand All @@ -131,8 +122,6 @@ export function registerDomain(adapter: McpAdapter): void {
* Returns an array of domains with basic information such as
* domain name, status, SSL configuration, and creation date.
*
* @todo Implementation is pending
*
* @param project_id - The project ID to list domains from
*/
adapter.server.tool(
Expand All @@ -143,7 +132,7 @@ export function registerDomain(adapter: McpAdapter): void {
},
async ({ project_id }) => {
log.debug(`List Domains in Project ${project_id}`);
const result = 'TODO'; //await adapter.client.domain.list(project_id);
const result = await adapter.client.domain.list(project_id);

return Response.json(result);
}
Expand All @@ -156,8 +145,6 @@ export function registerDomain(adapter: McpAdapter): void {
* This can be used to modify SSL settings, routing rules,
* or other domain-specific configurations.
*
* @todo Implementation is pending
*
* @param project_id - The project ID containing the domain
* @param domain_name - The domain name to update
*/
Expand All @@ -171,7 +158,7 @@ export function registerDomain(adapter: McpAdapter): void {
},
async ({ project_id, domain_name }) => {
log.debug(`Update Domain ${domain_name} in Project ${project_id}`);
const result = 'TODO'; //await adapter.client.domain.update(project_id, domain_name);
const result = await adapter.client.domain.update(project_id, domain_name);

return Response.json(result);
}
Expand Down
8 changes: 5 additions & 3 deletions upsun-mcp/src/command/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ export function registerEnvironment(adapter: McpAdapter): void {
* Tool: logs-environment
* Displays application logs for a specific environment.
*
* @todo This tool is not yet implemented and will return an error message.
*
* @param project_id - The project ID containing the environment
* @param environment_name - The name of the environment
* @param application_name - The name of the application to get logs from
Expand All @@ -161,7 +159,11 @@ export function registerEnvironment(adapter: McpAdapter): void {
log.debug(
`Get Logs of Application ${application_name} in Environment ${environment_name}, Project ${project_id}`
);
const result = { throw: 'Not implemented !' };
const result = await adapter.client.environment.logs(
project_id,
environment_name,
application_name
);

return Response.json(result);
}
Expand Down
5 changes: 2 additions & 3 deletions upsun-mcp/src/command/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,12 @@ export function registerProject(adapter: McpAdapter): void {
'Create a new upsun project',
{
organization_id: Schema.organizationId(),
//region_host: z.string().default("eu-5.platform.sh").optional(),
region_host: z.string().default('eu-5.platform.sh'),
name: z.string(),
default_branch: z.string().default('main').optional(),
},
async ({ organization_id, name, default_branch }) => {
async ({ organization_id, name, default_branch, region_host }) => {
log.debug(`Create Project: ${name} in Organization: ${organization_id}`);
const region_host = 'eu-5.platform.sh';
const subCreated = await adapter.client.project.create(
organization_id,
region_host,
Expand Down
3 changes: 2 additions & 1 deletion upsun-mcp/src/command/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,9 @@ export function registerRoute(adapter: McpAdapter): void {
},
async ({ project_id }) => {
log.debug(`Get Console URL of Project: ${project_id}`);
// const result = (await adapter.client.route.web(project_id)).ui;
//const result = (await adapter.client.route.web(project_id)).ui;
const result = 'Not implemented';

return Response.json(result);
}
);
Expand Down
15 changes: 3 additions & 12 deletions upsun-mcp/src/command/ssh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ const log = createLogger('MCP:Tool:ssh-commands');
* - delete-sshkey: Removes an existing SSH key from a user account
* - list-sshkey: Lists all SSH keys for a user account
*
* @note Many of these tools are currently marked as "TODO" and will return
* placeholder responses until implementation is complete.
*
* @param adapter - The MCP adapter instance to register tools with
*
* @example
Expand All @@ -44,8 +41,6 @@ export function registerSshKey(adapter: McpAdapter): void {
* SSH keys allow secure access to project environments for Git operations,
* shell access, and other remote operations without password authentication.
*
* @todo Implementation is pending
*
* @param user_id - The ID of the user to add the SSH key to
* @param ssh_key - The SSH public key content (starting with 'ssh-rsa', 'ssh-ed25519', etc.)
* @param key_id - A unique identifier or label for the SSH key
Expand All @@ -61,7 +56,7 @@ export function registerSshKey(adapter: McpAdapter): void {
},
async ({ user_id, ssh_key, key_id }) => {
log.debug(`Add SSH Key for User: ${user_id}, Key ID: ${key_id}`);
const result = 'TODO'; //await adapter.client.backup.create(project_id, environment_name);
const result = await adapter.client.ssh.add(user_id, ssh_key, key_id);

return Response.json(result);
}
Expand All @@ -76,8 +71,6 @@ export function registerSshKey(adapter: McpAdapter): void {
* for authentication. Make sure alternative access methods are available
* before removing keys.
*
* @todo Implementation is pending
*
* @param user_id - The ID of the user who owns the SSH key
* @param key_id - The unique identifier of the SSH key to delete
*/
Expand All @@ -91,7 +84,7 @@ export function registerSshKey(adapter: McpAdapter): void {
},
async ({ user_id, key_id }) => {
log.debug(`Delete SSH Key for User: ${user_id}, Key ID: ${key_id}`);
const result = 'TODO'; //await adapter.client.backup.create(project_id, environment_name);
const result = await adapter.client.ssh.delete(user_id, key_id);

return Response.json(result);
}
Expand All @@ -105,8 +98,6 @@ export function registerSshKey(adapter: McpAdapter): void {
* Returns an array of SSH keys with information such as key ID,
* fingerprint, type, and creation date.
*
* @todo Implementation is pending
*
* @param user_id - The ID of the user to list SSH keys for
*/
adapter.server.tool(
Expand All @@ -117,7 +108,7 @@ export function registerSshKey(adapter: McpAdapter): void {
},
async ({ user_id }) => {
log.debug(`List SSH Keys for User: ${user_id}`);
const result = 'TODO'; //await adapter.client.backup.create(project_id, environment_name);
const result = await adapter.client.ssh.list(user_id);

return Response.json(result);
}
Expand Down
Loading