Skip to content

⚙️ FEATURE-#36: Share MCP servers with pycodeloop's native saved: registry - #37

Merged
FernandoCelmer merged 7 commits into
masterfrom
feature/36
Aug 16, 2026
Merged

⚙️ FEATURE-#36: Share MCP servers with pycodeloop's native saved: registry#37
FernandoCelmer merged 7 commits into
masterfrom
feature/36

Conversation

@FernandoCelmer

@FernandoCelmer FernandoCelmer commented Aug 16, 2026

Copy link
Copy Markdown
Member

Description

  • src/services/mcpRegistry.service.ts — New service that reads/writes ~/.pycodeloop/config.json's mcp_servers section directly (same shape as pycodeloop's MCPServerRegistry), preserving every other top-level key. Exports splitCommand() (tokenizes a raw launch command into command/args, mirroring shlex.split() on the CLI side), saveMcpServer(), listSavedMcpServers(), and deleteSavedMcpServer().
  • src/features/settings/settings.controller.tsmanageMcpServers()'s add flow now calls maybeSaveToRegistry() before writing to VS Code settings. If the user opts in, the server is written to the shared pycodeloop registry and pycodeloop.mcpServers stores saved:<name> instead of the raw command string. Declining the prompt keeps the existing raw-command behavior unchanged.
  • test/mcpRegistry.service.test.ts — Unit tests covering splitCommand tokenizing: bare command, positional args, single/double-quoted segments, extra whitespace.

Motivation and Context

pycodeloop/mcp.py's MCPServerRegistry persists named MCP server configs so the CLI can reference one as --mcp saved:<name>, meant to be shared between the interactive CLI and serve. The plugin reimplemented its own MCP list entirely inside VS Code settings, never touching that registry — a user running both the extension and pycodeloop chat/run in a terminal had to configure the same servers twice. This is an additive change; declining the prompt keeps prior behavior exactly.

Closes #36.

Types of changes

  • New feature (change which adds functionality)
  • Bug fix
  • Documentation

Checklist

  • I have performed a self-review of my own code
  • I have added tests that prove my feature works
  • I have updated the CHANGELOG
  • I have updated the documentation accordingly

@FernandoCelmer FernandoCelmer left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

Code issues found: 4

# Severity Issue
1 [Blocking] Sync I/O blocks extension host
2 [Blocking] writeConfig — silent data loss on write failure
3 [Blocking] saveMcpServer silently overwrites existing entries
4 [Blocking] Registry name not validated — colon/space breaks saved: token

Comment thread src/services/mcpRegistry.service.ts
Comment thread src/services/mcpRegistry.service.ts Outdated
Comment thread src/services/mcpRegistry.service.ts
Comment thread src/features/settings/settings.controller.ts
@FernandoCelmer FernandoCelmer added enhancement New feature or request bug Something isn't working labels Aug 16, 2026
@FernandoCelmer

Copy link
Copy Markdown
Member Author

Code Review Summary

Code issues found: 4

# Severity Comment
1 [Blocking] Sync I/O blocks extension host
2 [Blocking] writeConfig — silent data loss on write failure
3 [Blocking] saveMcpServer silently overwrites existing entries
4 [Blocking] Registry name not validated — colon/space breaks saved: token

@FernandoCelmer FernandoCelmer left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — 3 blocking issues found (scores 75–90). See inline comments.

Comment thread src/services/mcpRegistry.service.ts
Comment thread src/services/mcpRegistry.service.ts
Comment thread src/features/settings/settings.controller.ts
Keep both maybeSaveToRegistry (feature/36) and toggleWorkspace (master)
in settings.controller.ts — methods were added at the same insertion point.
@FernandoCelmer
FernandoCelmer merged commit 0a5716e into master Aug 16, 2026
2 checks passed
@FernandoCelmer
FernandoCelmer deleted the feature/36 branch August 16, 2026 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Share MCP servers with pycodeloop's native saved: registry

1 participant