Skip to main content
Glama
powerdesigner-mcp-dfd
by 011011bjf

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
PDMCP_ATTACH_MODENoConfiguration environment variable (PDMCP_* prefix) documented in src/pd_mcp/config.py; controls the attach mode.
PDMCP_DEFAULT_DBMSNoConfiguration environment variable (PDMCP_* prefix) documented in src/pd_mcp/config.py; sets the default DBMS.
PDMCP_DFD_TEMPLATENoConfiguration environment variable (PDMCP_* prefix) documented in src/pd_mcp/config.py; points at another DFD .bpm template.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

PowerDesigner Database Modeling Automation MCP.

lets AI agents operate PowerDesigner (CDM/LDM/PDM) like a database modeling engineer: manage models, create tables/columns/primary keys/foreign keys/indexes/domains, apply structured schema patches, validate designs against rules, generate DDL and convert CDM->LDM->PDM - all through the official PowerDesigner COM Automation API (never by touching .pdm binaries).

Key behaviours:

  • Every mutating tool accepts dry_run=true to preview the plan.

  • apply_schema_patch / create_database_schema run atomically (auto-rollback).

  • begin_transaction / rollback_transaction give exact file-level restore.

  • Object references ("ref") returned by list/get tools can be passed to other tools; most tools also accept object codes for convenience.

  • Recommended course-design loop: inspect -> design -> dry_run -> apply -> validate_model / check_database_design -> fix -> generate_ddl -> save_model.

Data Flow Diagrams (Yourdon/DeMarco) live in separate .bpm models handled by the *_dfd tools (model ids dfdN): create_dfd_model or dfd_from_spec -> external entities, processes (parent= explodes a critical process into a child diagram), data stores, flows carrying data-dictionary elements -> check_dfd (including parent/child balancing) -> dfd_data_dictionary -> layout_dfd -> save.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_server_infoA

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_modelsA

List all models currently open in PowerDesigner with kind (PDM/CDM/LDM), name, code, file path, DBMS and object counts.

open_modelA

Open a PowerDesigner model file (.pdm / .cdm / .ldm) and return its info. Set read_only=true to prevent modifications.

create_modelA

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.

save_modelA

Save a model to its current file. Fails with a clear error when the model was never saved (use save_model_as first).

save_model_asA

Save a model to a new file path (.pdm/.cdm/.ldm extension is appended automatically). The target file must not exist yet.

close_modelB

Close a model in PowerDesigner. save=true saves to its file before closing.

get_model_infoA

Get detailed info about one open model: kind, name, code, file, DBMS, and counts of tables/entities, columns, keys, references, indexes, domains.

list_packagesA

List packages (sub-models/namespaces) of a model.

get_packageC

Get details of one package by ref, code or name.

list_tablesA

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.

get_tableB

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.

search_tablesB

Search tables by substring in code or name (case-insensitive).

list_columnsB

List the columns of a table (the attributes of a CDM/LDM entity) with full attributes. Optional text search.

get_columnC

Get one column's full detail.

search_columnsA

Search columns across the whole model (or one table) by substring in code/name. Returns table_code + column detail rows.

list_keysB

List keys of a table. The primary key has primary=true and its columns are included (supports single-column and composite keys).

get_keyB

Get one key by ref (from list_keys).

list_indexesA

List indexes of one table or of the whole model. Shows unique flag and covered columns (supports simple, unique and composite indexes).

get_indexC

Get one index's full detail.

list_referencesA

List foreign-key references (PDM) of a model: parent/child tables, join column pairs, cardinality and mandatory flag.

get_referenceC

Get one reference's full detail.

list_relationshipsA

List relationships of a CDM/LDM model (entity-to-entity relations). For PDM models use list_references instead.

get_relationshipB

Get one CDM/LDM relationship by ref.

list_domainsB

List domains (reusable data type definitions) of a model.

get_domainC

Get one domain's detail.

model_snapshotB

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.

inspect_schemaA

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.

compare_modelA

Structurally compare two open models: added/removed/modified tables, added/removed/modified columns per table, references and domains.

create_tableA

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.

rename_tableB

Rename a table (Name and/or Code). Supports dry_run.

update_tableC

Update table properties: name, code, comment. Supports dry_run.

delete_tableA

Delete a table (and PowerDesigner cascades its columns/keys/indexes and attached references). Destructive: prefer dry_run first.

create_columnA

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.

rename_columnB

Rename a column (Name and/or Code). Supports dry_run.

update_columnA

Update column properties: name, code, data_type, length, precision, mandatory, default_value, comment, description, domain, primary. Only supplied values are changed. Supports dry_run.

delete_columnA

Delete a column from a table. Destructive: prefer dry_run first.

create_primary_keyB

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.

set_primary_keyA

Alias of create_primary_key: replaces the table's primary key with the given columns (composite supported).

remove_primary_keyA

Remove the primary key from a table. Destructive: prefer dry_run first.

create_referenceA

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 (default '1,1'; set '0,n' on both for M:N). dependent_role marks a weak/dependent side as 'A'/'B', '1'/'2' or an entity code. Supports dry_run.

update_referenceB

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.

delete_referenceA

Delete a foreign-key reference (the FK columns in the child are kept). Destructive: prefer dry_run first.

create_indexA

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.

update_indexC

Update an index: name, unique flag, comment, or replace its columns. Supports dry_run.

delete_indexA

Delete an index. Destructive: prefer dry_run first.

create_database_schemaA

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 keys become identifiers, relationships become associations (cardinality = child end, parent_cardinality = parent end), and index entries are rejected. dry_run=true returns the execution plan without touching the model; atomic=true (default) rolls the model back if any step fails.

apply_schema_patchA

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.

design_from_specA

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.

validate_modelA

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.

check_database_designA

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.

generate_ddlA

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.

convert_cdm_to_ldmC

Convert a CDM model to an LDM. Uses PowerDesigner's native conversion when available, otherwise a structured mapping. Returns the new model info.

convert_cdm_to_pdmA

Convert a CDM model to a PDM (optionally pass dbms, e.g. 'MySQL 5.0'). Native conversion first, structured mapping as fallback.

convert_ldm_to_pdmC

Convert an LDM model to a PDM (optionally pass dbms). Native conversion first, structured mapping as fallback.

begin_transactionA

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.

commit_transactionA

Commit a transaction: keeps all changes and discards the backup.

rollback_transactionA

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.

list_model_backupsA

List available model backup files (created by transactions and save operations) in the backup directory.

rollback_modelA

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.

create_dfd_modelA

Create a new, empty Data Flow Diagram model (PowerDesigner BPM with the 'Data Flow Diagram' language), saved at once to 'path' (.bpm, must not exist). Returns its model_id (dfdN) for the other DFD tools.

open_dfd_modelC

Open an existing DFD .bpm file.

list_dfd_modelsA

List open DFD models with counts of entities, stores, processes, flows and data elements.

get_dfdB

Full structure of a DFD: external entities, data stores, the process tree (level, parent, composite) and every flow with source, destination, data and the diagram it is drawn on (diagram_of=null means the top diagram).

add_dfd_external_entityA

Add an external entity (actor or external system) - a rectangle in Yourdon notation. temporal=true models a temporal event such as the system clock: it is drawn only where a flow uses it and is ignored by balancing.

add_dfd_data_storeB

Add a data store (file/table). Do not use stores in a context diagram; they belong to level 1 and below.

add_dfd_processA

Add a process. Without 'parent' it goes on the top diagram (the context diagram's single process '0', or the level-1 processes). With parent= it is a child process of that one (the parent becomes composite and gets its own diagram). Use the code as the process number: '0', '1', '1.1'.

name_dfd_diagramB

Rename a DFD diagram: the top diagram when process is empty, otherwise the child diagram of that composite process (e.g. 'Nivel 2 - 4.0 Gestionar citas').

decompose_dfd_processC

Make a process composite so it gets a child diagram (exploding a critical process into the next DFD level).

add_dfd_flowA

Add a data flow and draw it. source/destination are codes or names of processes, external entities or data stores; at least one end must be a process. Two processes must share a parent, or one must be a sibling of the other's parent (e.g. child 4.3 -> 7.0: drawn on 4.0's child diagram). A flow touching a data store becomes a store access: out of the store = 'read', into it = 'update' (or pass access='create'|'delete'). Name it with a noun (the data); 'data' lists data-dictionary elements it carries (created when missing). The flow is drawn on the diagram of its process end.

add_dfd_data_elementC

Add or update a data-dictionary element. 'definition' holds the composition in DeMarco notation, e.g. 'credenciales = usuario + contraseña', 'paciente = identificacion + nombres + (correo)'.

dfd_data_dictionaryB

Build the data dictionary of a DFD: every data element with its definition and the flows that carry it, as JSON plus a Markdown table. Pass output_path (.md) to also write it to a file.

check_dfdA

Check DFD rules: black holes / miracles / isolated processes, isolated or write-only/read-only stores, isolated entities, flows not in the data dictionary, unused data, stores on a context diagram, and parent/child balancing of every decomposed process.

layout_dfdB

Lay out the top diagram and every child diagram of a DFD. style='lanes' (default): one row per process, every flow on its own straight lane so no two labels overlap; partners talking to several processes are drawn once per row (graphical synonyms, ': n' suffix). style='auto': PowerDesigner's AutoLayout. Save and reopen the model to see the final label positions.

save_dfd_modelC

Save a DFD model to its file.

close_dfd_modelC

Close a DFD model (save=true saves first).

dfd_from_specA

Build a whole DFD in one call, lay it out, save it and check it. spec = {name, path (.bpm, new), code?, comment?, data: [{name, code?, definition?, comment?}], external_entities: [{name, code?, comment?, temporal?}], data_stores: [{name, code?, comment?}], processes: [{name, code?, comment?, parent?}] (parent = code of a process to explode; any order), flows: [{source, destination, name?, code?, data?: [names], access?, comment?}], diagram_names?: {"": top diagram title, : child diagram title}}. Context diagram: one process, entities, flows, no stores. Critical processes: add children with parent= plus their flows and stores. On error the file is left as an empty DFD. Large specs: pass spec_path (a UTF-8 .json file with the same shape) instead of spec.

export_dfd_imagesA

Export every diagram of a DFD model (top and each decomposed process) as PNG files into an existing folder. Labels are placed as PowerDesigner shows them after the model is saved and reopened.

Prompts

Interactive templates invoked by user choice

NameDescription
database_design_workflow数据库课程设计全流程工作流:需求 → CDM → LDM → PDM → 约束/索引 → 校验 → DDL。参数:需求描述与模型文件路径(可选)。
schema_review对现有模型做一次评审:结构校验 + 自定义规范规则 + 修复建议。

Resources

Contextual data attached and managed by the client

NameDescription
Open modelsAll models currently open in PowerDesigner.

TDQS

C2.9/5.0

Scored across 78 tools

Disambiguation3/5

Most tools target a distinct object type plus action, but several pairs overlap meaningfully: model_snapshot vs inspect_schema (both 'compact JSON of the schema to save context'), list_tables/search_tables and list_columns/search_columns (search is just a filtered list), and rename_table/rename_column vs update_table/update_column (rename is a subset of update). set_primary_key is an explicit alias of create_primary_key, and create_database_schema / design_from_spec / apply_schema_patch / dfd_from_spec are four bulk-construction tools with fuzzy boundaries, plus three separate validators (validate_model, check_database_design, check_dfd).

Naming Consistency4/5

The surface is overwhelmingly consistent snake_case with verb_noun ordering (create_table, list_columns, delete_index, update_reference). Minor deviations exist: noun-first names (model_snapshot, dfd_data_dictionary) and verb-last names (dfd_from_spec, design_from_spec, export_dfd_images), and the DFD prefix placement varies (create_dfd_model vs dfd_from_spec vs get_dfd).

Tool Count2/5

78 tools is far beyond a comfortable surface for an agent, even granting that the server spans two real domains (relational/CDM/LDM modeling plus DFD authoring). The count is inflated by redundancy: an explicit alias, three overlapping whole-schema build paths, three validators, and both search_* and list_* variants of the same queries.

Completeness3/5

Core relational lifecycle is well covered (models, tables, columns, keys, indexes, references, transactions, backups, DDL, conversions, validation). However there is no standalone create_domain/update_domain/delete_domain tool (create_domain only exists as a patch op), no delete_model, and the DFD side is add-only — no tools to rename, move, modify or delete DFD processes, stores, entities, flows, or data elements once created.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues