allow setting options at mcp install time#40
Conversation
|
Automated review 🤖 Summary of Changes Key Changes & Positives
Potential Issues & Recommendations
Language/Framework Checks
Security & Privacy
Tests
Approval Recommendation
|
There was a problem hiding this comment.
Pull request overview
This PR enables passing through MCP server “metadata” options at package install time so that newly installed servers can be created with richer configuration (display name/description, secret metadata, URLs, catalog info, startup timeout), and expands tests to cover these new fields.
Changes:
- Forward server metadata fields from
PackageService.installPackageintoMCPService.addServerfor python, node stdio, and streamable HTTP installs. - Extend
packages-python.spec.tsto assert metadata forwarding behavior across runtimes/transports. - Bump
package.jsonversion from1.11.6to1.11.7.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test/packages-python.spec.ts | Adds assertions/tests ensuring install-time server metadata is forwarded for python/node/streamable HTTP installs. |
| src/services/packages.ts | Introduces a typed metadata subset and spreads it into mcpService.addServer calls. |
| package.json | Patch version bump for release. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| private buildServerMetadataInput(request: InstallPackageRequest): PackageInstallServerMetadata { | ||
| return { | ||
| displayName: request.displayName, | ||
| description: request.description, | ||
| secretName: request.secretName, | ||
| secretNames: request.secretNames, | ||
| secretFields: request.secretFields, | ||
| homepageUrl: request.homepageUrl, | ||
| repositoryUrl: request.repositoryUrl, | ||
| licenseName: request.licenseName, | ||
| catalogProvider: request.catalogProvider, | ||
| catalogId: request.catalogId, | ||
| startupTimeout: request.startupTimeout | ||
| } |
There was a problem hiding this comment.
installPackage now forwards user-provided secretNames/secretFields (and other metadata) into MCPService.addServer, but for platform servers addServer doesn't apply the external-server validations (max secret fields, field name pattern, etc.). Since this input comes from the install request, it should be validated/normalized in PackageService (e.g., cap the number of secret fields and enforce the same field.name pattern used in MCPService.addServer) before persisting it on the server record.
| const addServerInput = mcpMock.addServer.mock.calls[0][0] as { | ||
| command: string | ||
| args: string[] | ||
| env: Record<string, string> | ||
| displayName: string | ||
| description: string | ||
| secretNames: string[] | ||
| secretFields: Array<{ name: string; label: string; description: string; required: boolean; inputType: string }> | ||
| homepageUrl: string | ||
| repositoryUrl: string | ||
| licenseName: string | ||
| catalogProvider: string | ||
| catalogId: string | ||
| startupTimeout: number |
There was a problem hiding this comment.
The test is using a custom inline type assertion for addServerInput, which weakens type-safety for fields like catalogProvider (should be 'glama' | 'manual') and secretFields[].inputType (literal 'password'). Prefer typing this as AddServerInput (or Pick<AddServerInput, ...>) via a type-only import from src/services/mcp to keep the test aligned with the real API shape.
| test('installPackage forwards server metadata for node stdio packages', async () => { | ||
| const { service, mcpMock } = createService() | ||
|
|
||
| mcpMock.addServer.mockResolvedValue({ | ||
| name: 'node-server', | ||
| transportType: 'stdio', |
There was a problem hiding this comment.
This spec file/describe block is scoped to “python runtime support”, but these newly added cases also cover node stdio and streamable HTTP installs. Consider moving these new tests into a more appropriately named suite/file (or splitting describe blocks) so future changes to node/HTTP install behavior are discoverable.
No description provided.