powerdesigner-mcp
v0.1.2MCP server that drives PowerDesigner 16.5 over COM: AI agents design CDM/LDM/PDM models, validate them and generate DDL
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_server_info
Check the PowerDesigner connection and report server capabilities. Call this first to verify PowerDesigner is reachable (or that the mock backend is active). Returns version, attach mode, open model count.
list_open_models
List all models currently open in PowerDesigner with kind (PDM/CDM/LDM), name, code, file path, DBMS and object counts.
open_model
Open a PowerDesigner model file (.pdm / .cdm / .ldm) and return its info. Set read_only=true to prevent modifications.
| Parameter | Type | Description |
|---|---|---|
path * | string | |
read_only | boolean |
create_model
Create a new empty model. kind: 'PDM' | 'CDM' | 'LDM'. For PDM you may pass dbms (e.g. 'MySQL 5.0'); PowerDesigner picks its default when omitted. Returns the new model info including its model_id.
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
name * | string | |
code | string | |
dbms | string |
save_model
Save a model to its current file. Fails with a clear error when the model was never saved (use save_model_as first).
| Parameter | Type | Description |
|---|---|---|
model_id * | string |
save_model_as
Save a model to a new file path (.pdm/.cdm/.ldm extension is appended automatically). The target file must not exist yet.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
path * | string |
close_model
Close a model in PowerDesigner. save=true saves to its file before closing.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
save | boolean |
get_model_info
Get detailed info about one open model: kind, name, code, file, DBMS, and counts of tables/entities, columns, keys, references, indexes, domains.
| Parameter | Type | Description |
|---|---|---|
model_id * | string |
list_packages
List packages (sub-models/namespaces) of a model.
| Parameter | Type | Description |
|---|---|---|
model_id * | string |
get_package
Get details of one package by ref, code or name.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
package_ref * | string |
list_tables
List tables (PDM) or entities (CDM/LDM) of a model. Supports text search over code/name and optional package filter. Returns brief rows - use get_table for full detail.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
package_ref | string | |
page | integer | |
page_size | integer | |
query | string |
get_table
Get full detail of one table/entity by ref or code: columns (type, length, mandatory, default, comment, primary), keys, primary key, indexes and incoming/outgoing references.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
table_ref * | string |
search_tables
Search tables by substring in code or name (case-insensitive).
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
query * | string | |
page | integer | |
page_size | integer |
list_columns
List the columns of a table (the attributes of a CDM/LDM entity) with full attributes. Optional text search.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
table_ref * | string | |
query | string |
get_column
Get one column's full detail.
| Parameter | Type | Description |
|---|---|---|
column_ref * | string | |
model_id * | string | |
table_ref * | string |
search_columns
Search columns across the whole model (or one table) by substring in code/name. Returns table_code + column detail rows.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
query * | string | |
page | integer | |
page_size | integer | |
table_ref | string |
list_keys
List keys of a table. The primary key has primary=true and its columns are included (supports single-column and composite keys).
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
table_ref * | string |
get_key
Get one key by ref (from list_keys).
| Parameter | Type | Description |
|---|---|---|
key_ref * | string | |
model_id * | string | |
table_ref * | string |
list_indexes
List indexes of one table or of the whole model. Shows unique flag and covered columns (supports simple, unique and composite indexes).
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
table_ref | string |
get_index
Get one index's full detail.
| Parameter | Type | Description |
|---|---|---|
index_ref * | string | |
model_id * | string | |
table_ref * | string |
list_references
List foreign-key references (PDM) of a model: parent/child tables, join column pairs, cardinality and mandatory flag.
| Parameter | Type | Description |
|---|---|---|
model_id * | string |
get_reference
Get one reference's full detail.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
reference_ref * | string |
list_relationships
List relationships of a CDM/LDM model (entity-to-entity relations). For PDM models use list_references instead.
| Parameter | Type | Description |
|---|---|---|
model_id * | string |
get_relationship
Get one CDM/LDM relationship by ref.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
relationship_ref * | string |
list_domains
List domains (reusable data type definitions) of a model.
| Parameter | Type | Description |
|---|---|---|
model_id * | string |
get_domain
Get one domain's detail.
| Parameter | Type | Description |
|---|---|---|
domain_ref * | string | |
model_id * | string |
model_snapshot
Convert the model into compact JSON the AI can reason over. mode='summary': one line per table + references. mode='detail': full columns/keys/indexes/references. Optionally restrict to given table codes.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
mode | string |
inspect_schema
Inspect the whole schema at once. mode='summary'|'detail', optional single table, paginated. Returns tables + foreign keys view; use this instead of many list_* calls to save context.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
mode | string | |
page | integer | |
page_size | integer | |
table | string |
compare_model
Structurally compare two open models: added/removed/modified tables, added/removed/modified columns per table, references and domains.
| Parameter | Type | Description |
|---|---|---|
model_id_a * | string | |
model_id_b * | string |
create_table
Create a table (PDM) or entity (CDM/LDM). Optionally pass an inline 'columns' array (same shape as create_column's column spec) to create columns in the same call. Supports dry_run.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
name * | string | |
code | string | |
columns | ||
comment | string | |
dry_run | boolean |
rename_table
Rename a table (Name and/or Code). Supports dry_run.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
table_ref * | string | |
dry_run | boolean | |
new_code | string | |
new_name | string |
update_table
Update table properties: name, code, comment. Supports dry_run.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
table_ref * | string | |
code | string | |
comment | string | |
dry_run | boolean | |
name | string |
delete_table
Delete a table (and PowerDesigner cascades its columns/keys/indexes and attached references). Destructive: prefer dry_run first.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
table_ref * | string | |
dry_run | boolean |
create_column
Add a column to a table (an attribute, in CDM/LDM terms). Supported properties: name, code, data_type (e.g. 'VARCHAR', 'INT', 'DATETIME'), length, precision, mandatory, default_value, comment, description, domain (ref or code), primary (include in primary key). In a CDM/LDM the data type is rendered in PowerDesigner's own vocabulary ('Variable characters(20)') and 'primary' is ignored - primacy is set with create_primary_key. Supports dry_run.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
name * | string | |
table_ref * | string | |
code | string | |
comment | string | |
data_type | string | |
default_value | string | |
domain | string | |
dry_run | boolean | |
length | integer | |
mandatory | boolean | |
precision | integer | |
primary | boolean |
rename_column
Rename a column (Name and/or Code). Supports dry_run.
| Parameter | Type | Description |
|---|---|---|
column_ref * | string | |
model_id * | string | |
table_ref * | string | |
dry_run | boolean | |
new_code | string | |
new_name | string |
update_column
Update column properties: name, code, data_type, length, precision, mandatory, default_value, comment, description, domain, primary. Only supplied values are changed. Supports dry_run.
| Parameter | Type | Description |
|---|---|---|
column_ref * | string | |
model_id * | string | |
table_ref * | string | |
code | string | |
comment | string | |
data_type | string | |
default_value | string | |
domain | string | |
dry_run | boolean | |
length | integer | |
mandatory | boolean | |
name | string | |
precision | integer | |
primary | boolean |
delete_column
Delete a column from a table. Destructive: prefer dry_run first.
| Parameter | Type | Description |
|---|---|---|
column_ref * | string | |
model_id * | string | |
table_ref * | string | |
dry_run | boolean |
create_primary_key
Create (or replace) the primary key of a table from the given column codes. Supports single-column and composite keys, e.g. columns=['order_id','product_id']. Existing PK membership is cleared. In a CDM/LDM this builds the entity's primary identifier (attributes carry no primary flag there) and points the entity at it. Supports dry_run.
| Parameter | Type | Description |
|---|---|---|
columns * | array | |
model_id * | string | |
table_ref * | string | |
code | string | |
dry_run | boolean | |
name | string |
set_primary_key
Alias of create_primary_key: replaces the table's primary key with the given columns (composite supported).
| Parameter | Type | Description |
|---|---|---|
columns * | array | |
model_id * | string | |
table_ref * | string | |
dry_run | boolean | |
name | string |
remove_primary_key
Remove the primary key from a table. Destructive: prefer dry_run first.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
table_ref * | string | |
dry_run | boolean |
create_reference
Create an association between two objects. In a PDM this is a foreign-key reference (parent 1--N child); if parent_columns/child_columns are omitted the parent's primary key is used and FK columns are auto-created in the child (update_key=true, e.g. user 1--N order creates order.user_id). In a CDM/LDM it is a conceptual relationship between entities: parent_table/child_table name Entity1/Entity2, parent_columns/child_columns/update_key are ignored. cardinality = multiplicity at the child end ('0,n', '1,1', '1,n'; '0..*' also accepted); parent_cardinality = multiplicity at the parent end (defau…
| Parameter | Type | Description |
|---|---|---|
child_table * | string | |
model_id * | string | |
parent_table * | string | |
cardinality | string | |
child_columns | ||
code | string | |
comment | string | |
dependent_role | string | |
dry_run | boolean | |
name | string | |
parent_cardinality | string | |
parent_columns | ||
update_key | boolean |
update_reference
Update a reference: name, code, comment, mandatory, parent_role, child_role, cardinality ('0,n', '1,1', ...), parent_cardinality. In a CDM/LDM the cardinalities map onto the two role cardinalities and dependent_role ('A'/'B') marks the dependent side. Supports dry_run.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
reference_ref * | string | |
cardinality | string | |
child_role | string | |
code | string | |
comment | string | |
dependent_role | string | |
dry_run | boolean | |
mandatory | boolean | |
name | string | |
parent_cardinality | string | |
parent_role | string |
delete_reference
Delete a foreign-key reference (the FK columns in the child are kept). Destructive: prefer dry_run first.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
reference_ref * | string | |
dry_run | boolean |
create_index
Create an index on a table: normal, unique or composite. Example: columns=['user_id','create_time'], name='idx_order_user_time'. PDM only - indexes are a physical concept and a CDM/LDM is rejected. Supports dry_run.
| Parameter | Type | Description |
|---|---|---|
columns * | array | |
model_id * | string | |
table_ref * | string | |
comment | string | |
dry_run | boolean | |
name | string | |
unique | boolean |
update_index
Update an index: name, unique flag, comment, or replace its columns. Supports dry_run.
| Parameter | Type | Description |
|---|---|---|
index_ref * | string | |
model_id * | string | |
table_ref * | string | |
columns | ||
comment | string | |
dry_run | boolean | |
name | string | |
unique | boolean |
delete_index
Delete an index. Destructive: prefer dry_run first.
| Parameter | Type | Description |
|---|---|---|
index_ref * | string | |
model_id * | string | |
table_ref * | string | |
dry_run | boolean |
create_database_schema
Create a whole schema in one call from a JSON spec: {tables:[{name, code, comment, columns:[{name, code, data_type, length, precision, mandatory, default_value, comment, primary}], indexes:[...]}], relationships:[{parent_table, child_table, parent_columns, child_columns, name, cardinality, parent_cardinality, dependent_role}], domains:[...], indexes:[...]}. Primary keys are derived from columns with primary:true (or primary_key_columns). The plan follows the target model's kind: in a CDM/LDM 'tables' are entities, columns are attributes rendered in PowerDesigner's own type vocabulary, primary…
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
spec * | object | |
atomic | boolean | |
dry_run | boolean |
apply_schema_patch
Apply an ordered list of structured patch operations to a model. operations: [{op: create_table|alter_table|rename_table|drop_table|add_column|alter_column|drop_column|create_primary_key|drop_primary_key|create_reference|alter_reference|drop_reference|create_index|alter_index|drop_index|create_domain, ...}]. Execution stops at the first failure and (atomic, default) rolls back. dry_run=true returns the plan.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
operations * | array | |
atomic | boolean | |
dry_run | boolean |
design_from_spec
Materialise a full design spec into a NEW model (or extend an existing one via model_id). spec: {model:{kind: 'PDM'|'CDM'|'LDM', name, code, dbms}, tables/entities:[...], relationships:[...], domains:[...], indexes:[...]}. The AI supplies the design; this tool executes it. Supports dry_run.
| Parameter | Type | Description |
|---|---|---|
spec * | object | |
atomic | boolean | |
dry_run | boolean | |
model_id | string |
validate_model
Run built-in structural checks on a model: missing primary keys, duplicate table/column codes, missing data types, missing comments, FK type mismatches, dangling references, duplicate/redundant indexes. Returns passed/errors/warnings with object locations - fix issues and re-run to close the loop.
| Parameter | Type | Description |
|---|---|---|
model_id * | string |
check_database_design
Check a model against YOUR design rules. rules: [{id, description, type, params?, severity?}]. Machine-checkable types: TABLE_HAS_PK, TABLE_CODE_PATTERN, TABLE_NAME_STYLE, COLUMN_HAS_COMMENT, COLUMN_CODE_PATTERN, COLUMN_MANDATORY, REQUIRED_COLUMNS, PK_NAME_PATTERN, FK_NAME_PATTERN, INDEX_NAME_PATTERN, DATA_TYPE_ALLOWED, NO_DUPLICATE_INDEX, NO_EMPTY_COMMENT_TABLE, REGEX. Rules with unknown types are reported in 'skipped' (never silently ignored). Returns passed/errors/warnings/violations.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
rules * | array |
generate_ddl
Generate SQL DDL for a PDM using PowerDesigner's native database generation for the model's DBMS. output_path: target .sql file (created if the directory exists). Returns the SQL text plus file info. The model's own DBMS is used; requesting a different dbms returns a clear error.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
output_path * | string | |
dbms | string |
convert_cdm_to_ldm
Convert a CDM model to an LDM. Uses PowerDesigner's native conversion when available, otherwise a structured mapping. Returns the new model info.
| Parameter | Type | Description |
|---|---|---|
model_id * | string |
convert_cdm_to_pdm
Convert a CDM model to a PDM (optionally pass dbms, e.g. 'MySQL 5.0'). Native conversion first, structured mapping as fallback.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
dbms | string |
convert_ldm_to_pdm
Convert an LDM model to a PDM (optionally pass dbms). Native conversion first, structured mapping as fallback.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
dbms | string |
begin_transaction
Start a transaction before a batch of modifications. For file-backed models the current file is saved and backed up so rollback can restore the exact pre-transaction state. Pass the returned txn_id to commit_transaction / rollback_transaction.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
auto_save | boolean |
commit_transaction
Commit a transaction: keeps all changes and discards the backup.
| Parameter | Type | Description |
|---|---|---|
txn_id * | string |
rollback_transaction
Roll a transaction back: file-backed models are restored from the pre-transaction backup and reopened (the model_id may change - run list_open_models). Without a file backup, create/update operations are undone via the operation journal; deletions without backup cannot be undone and are reported explicitly.
| Parameter | Type | Description |
|---|---|---|
txn_id * | string |
list_model_backups
List available model backup files (created by transactions and save operations) in the backup directory.
rollback_model
Restore a model from a backup file (latest backup, or pass backup_file from list_model_backups). Closes the model, restores the file and reopens it.
| Parameter | Type | Description |
|---|---|---|
model_id * | string | |
backup_file | string |