Skip to content

Commit a6b6672

Browse files
committed
Fix: Only add new servers to unrestricted groups by default
Modified add_server_to_scopes() to only add newly registered servers to unrestricted groups (mcp-servers-unrestricted/read and execute). Previously, servers were being added to both unrestricted AND restricted groups, which violated the principle of least privilege. Changes: - registry/utils/scopes_manager.py: Updated sections list in add_server_to_scopes() to only include unrestricted groups - docs/service-management.md: Added documentation explaining the default behavior when registering new servers This ensures new servers are only accessible to users with unrestricted permissions by default. Administrators can explicitly add servers to restricted groups using add_server_to_groups() when needed.
1 parent 35096ae commit a6b6672

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

docs/service-management.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,14 @@ This complete example demonstrates the full lifecycle of server management using
416416

417417
## Advanced Scopes Management
418418

419+
### Default Server Registration Behavior
420+
421+
When a new server is registered, it is **automatically added to unrestricted scopes groups only**:
422+
- `mcp-servers-unrestricted/read`
423+
- `mcp-servers-unrestricted/execute`
424+
425+
This means that by default, newly registered servers are accessible to users with unrestricted permissions. If you need to add a server to restricted groups or change its access level, use the commands below.
426+
419427
### Adding Servers to Custom Scopes Groups
420428

421429
You can dynamically add servers to specific scopes groups using the service management script. This is useful for fine-grained access control where you want to assign different servers to different user groups.

registry/utils/scopes_manager.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,12 +106,10 @@ async def add_server_to_scopes(server_path: str, server_name: str, tools: List[s
106106
# Create the server entry
107107
server_entry = _create_server_entry(server_path, tools)
108108

109-
# Add to all standard scope sections
109+
# Add to unrestricted scope sections only
110110
sections = [
111111
"mcp-servers-unrestricted/read",
112-
"mcp-servers-unrestricted/execute",
113-
"mcp-servers-restricted/read",
114-
"mcp-servers-restricted/execute"
112+
"mcp-servers-unrestricted/execute"
115113
]
116114

117115
modified = False

0 commit comments

Comments
 (0)