Skip to content

Add named structure sources management (CLI + MCP)#148

Merged
httpdss merged 1 commit intomainfrom
codex/add-command-to-mcp-from-issue-139
May 10, 2026
Merged

Add named structure sources management (CLI + MCP)#148
httpdss merged 1 commit intomainfrom
codex/add-command-to-mcp-from-issue-139

Conversation

@httpdss
Copy link
Copy Markdown
Owner

@httpdss httpdss commented May 10, 2026

Motivation

  • Provide a convenient way to register and reuse named local structure sources so users don't have to pass --structures-path or set STRUCTKIT_STRUCTURES_PATH repeatedly.
  • Allow structure resolution to accept a <source>/<structure> prefix and a --source flag, while preserving --structures-path precedence.
  • Expose source management over MCP so external tools can list/add/remove/validate named sources programmatically.

Description

  • Add new utilities in structkit/sources.py including read_sources, write_sources, add_source, remove_source, resolve_structures_path, and related helpers and SourceError for config handling and validation.
  • Add a new CLI command group structkit sources in structkit/commands/sources.py with subcommands list, add, remove, show, and validate and support for --config-path (STRUCTKIT_SOURCES_CONFIG).
  • Integrate named source resolution into generate and list via a new --source option and by calling resolve_structures_path, and register SourcesCommand in structkit/main.py.
  • Extend MCP server (structkit/mcp_server.py) with manage_sources tool and wire generate_structure to accept an optional source parameter so MCP generation resolves named sources.
  • Update documentation in docs/custom-structures.md and docs/cli-reference.md to describe sources usage and resolution precedence, and add tests/test_sources_command.py covering config read/write, CLI flows, precedence, and MCP management.

Testing

  • Ran the full test suite with pytest which completed successfully: 185 passed.
  • Ran the new focused tests with python -m pytest tests/test_sources_command.py which completed successfully: 7 passed.
  • Verified module compilation with python -m py_compile for the modified modules and inspected structkit sources --help output; all checks succeeded.

Codex Task

@httpdss httpdss added enhancement New feature or request minor feature labels May 10, 2026
@httpdss httpdss merged commit a63f5f7 into main May 10, 2026
3 checks passed
@httpdss httpdss deleted the codex/add-command-to-mcp-from-issue-139 branch May 10, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant