Skip to content

oci-api-mcp-server crashes if the output from the ocli cli isn't json #37

@AmedeeBulle

Description

@AmedeeBulle

Some oci cli commands are returning plain text -- E.g.:

$ oci iam db-token get --scope "${iot_db_token_scope}"       
Private key written at /home/<redacted>/.oci/db-token/oci_db_key.pem
db-token written at: /home/<redacted>/.oci/db-token/token
db-token is valid until 2025-10-20 23:13:48

The oci-api-mcp-server runs json.loads(result.stdout) without safeguard, generating a stack trace when it is not json:

Possible fix would be to to wrap the output in json when it is not serializable -- e.g. { "response" : result.stdout}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions