Skip to content

Commit 59783ec

Browse files
authored
Remove --sensitive-info flag (#13)
1 parent 9c3b2a0 commit 59783ec

File tree

11 files changed

+6
-463
lines changed

11 files changed

+6
-463
lines changed

README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,6 @@ feedback or would like to report a bug or feature request, please [create a GitH
145145
- **get_service** - Get details about a specific service
146146
- `serviceId`: The ID of the service to retrieve (string, required)
147147

148-
- **list_environment_variables** - List all environment variables for a service.
149-
(only if the `--include-sensitive-info` flag is enabled).
150-
- `serviceId`: The ID of the service to retrieve variables for (string, required)
151-
152148
- **create_web_service** - Create a new web service in your Render account
153149
- `name`: A unique name for your service (string, required)
154150
- `runtime`: Runtime environment for your service. Accepted values: 'node', 'python', 'go', 'rust', 'ruby', 'elixir', 'docker' (string, required)
@@ -227,10 +223,6 @@ feedback or would like to report a bug or feature request, please [create a GitH
227223
- **get_postgres** - Get details about a specific PostgreSQL database
228224
- `postgresId`: The ID of the PostgreSQL database to retrieve (string, required)
229225

230-
- **get_postgres_connection_info** - Get connection information for a PostgreSQL database.
231-
(only if the `--include-sensitive-info` flag is enabled).
232-
- `postgresId`: The ID of the PostgreSQL database to retrieve (string, required)
233-
234226
- **create_postgres** - Create a new PostgreSQL database
235227
- `name`: Name of the PostgreSQL database (string, required)
236228
- `plan`: Pricing plan for the database. Accepted values: 'free', 'basic_256mb', 'basic_1gb', 'basic_4gb', 'pro_4gb', 'pro_8gb', 'pro_16gb', 'pro_32gb', 'pro_64gb', 'pro_128gb', 'pro_192gb', 'pro_256gb', 'pro_384gb', 'pro_512gb', 'accelerated_16gb', 'accelerated_32gb', 'accelerated_64gb', 'accelerated_128gb', 'accelerated_256gb', 'accelerated_384gb', 'accelerated_512gb', 'accelerated_768gb', 'accelerated_1024gb' (string, required)
@@ -246,10 +238,6 @@ feedback or would like to report a bug or feature request, please [create a GitH
246238
- **get_key_value** - Get details about a specific Key Value instance
247239
- `keyValueId`: The ID of the Key Value instance to retrieve (string, required)
248240

249-
- **get_key_value_connection_info** - Get connection information for a Key Value instance.
250-
(only if the `--include-sensitive-info` flag is enabled).
251-
- `keyValueId`: The ID of the Key Value instance to retrieve (string, required)
252-
253241
- **create_key_value** - Create a new Key Value instance
254242
- `name`: Name of the Key Value instance (string, required)
255243
- `plan`: Pricing plan for the Key Value instance. Accepted values: 'free', 'starter', 'standard', 'pro', 'pro_plus' (string, required)

main.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,20 @@ import (
77

88
"github.com/render-oss/render-mcp-server/cmd"
99
"github.com/render-oss/render-mcp-server/pkg/cfg"
10-
"github.com/render-oss/render-mcp-server/pkg/config"
1110
)
1211

1312
func main() {
1413
// Define and parse command line flags
15-
includeSensitiveInfo := flag.Bool(
16-
"include-sensitive-info",
17-
false,
18-
"Include sensitive information in responses. Turn this on if you don't mind including "+
19-
"potentially sensitive information such as environment variables or database credentials "+
20-
"in your LLM context.",
21-
)
22-
2314
versionFlag := flag.Bool("version", false, "Print version information and exit")
2415
flag.BoolVar(versionFlag, "v", false, "Print version information and exit")
2516

2617
flag.Parse()
2718

28-
// Print version and exit if version flag is provided
2919
if *versionFlag {
3020
fmt.Println("render-mcp-server version", cfg.Version)
3121
os.Exit(0)
3222
}
3323

34-
config.InitRuntimeConfig(*includeSensitiveInfo)
35-
3624
// Start the server
3725
cmd.Serve()
3826
}

pkg/config/config.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,6 @@ const workspaceEnvKey = "RENDER_WORKSPACE"
2121
var ErrNoWorkspace = errors.New("no workspace set. Prompt the user to select a workspace. Do NOT try to select a workspace for them, as it may be destructive")
2222
var ErrLogin = errors.New("not authenticated; either set RENDER_API_KEY or ask your MCP host to authenticate")
2323

24-
// RuntimeConfig holds application runtime configuration settings. It should not be persisted to disk.
25-
type RuntimeConfig struct {
26-
includeSensitiveInfo bool
27-
}
28-
29-
var runtimeConfig *RuntimeConfig
30-
31-
func InitRuntimeConfig(includeSensitiveInfo bool) {
32-
runtimeConfig = &RuntimeConfig{
33-
includeSensitiveInfo: includeSensitiveInfo,
34-
}
35-
}
36-
37-
// IncludeSensitiveInfo returns whether sensitive info should be included in tool reponse to the MCP host.
38-
func IncludeSensitiveInfo() bool {
39-
if runtimeConfig == nil {
40-
return false
41-
}
42-
return runtimeConfig.includeSensitiveInfo
43-
}
44-
4524
type Config struct {
4625
Version int `yaml:"version"`
4726
Workspace string `yaml:"workspace"`

pkg/keyvalue/repo.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,19 +64,6 @@ func (r *Repo) GetKeyValue(ctx context.Context, id string) (*client.KeyValueDeta
6464
return resp.JSON200, nil
6565
}
6666

67-
func (r *Repo) GetKeyValueConnectionInfo(ctx context.Context, id string) (*client.KeyValueConnectionInfo, error) {
68-
resp, err := r.client.RetrieveKeyValueConnectionInfoWithResponse(ctx, id)
69-
if err != nil {
70-
return nil, err
71-
}
72-
73-
if err := client.ErrorFromResponse(resp); err != nil {
74-
return nil, err
75-
}
76-
77-
return resp.JSON200, nil
78-
}
79-
8067
func (r *Repo) CreateKeyValue(ctx context.Context, input client.KeyValuePOSTInput) (*client.KeyValueDetail, error) {
8168
if err := validate.WorkspaceMatches(input.OwnerId); err != nil {
8269
return nil, err

pkg/keyvalue/tools.go

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ func Tools(c *client.ClientWithResponses) []server.ServerTool {
1919
return []server.ServerTool{
2020
listKeyValue(keyValueRepo),
2121
getKeyValue(keyValueRepo),
22-
getKeyValueConnectionInfo(keyValueRepo),
2322
createKeyValue(keyValueRepo),
2423
}
2524
}
@@ -91,55 +90,6 @@ func getKeyValue(keyValueRepo *Repo) server.ServerTool {
9190
}
9291
}
9392

94-
func getKeyValueConnectionInfo(keyValueRepo *Repo) server.ServerTool {
95-
return server.ServerTool{
96-
Tool: mcp.NewTool("get_key_value_connection_info",
97-
mcp.WithDescription("Retrieve connection info for a Key Value instance by ID. "+
98-
"Connection info includes sensitive information. \n\n"+
99-
"The returned internalConnectionString should be used as a connection string by "+
100-
"services within Render to connect to the Key Value instance. "+
101-
"The externalConnectionString should be outside of Render (e.g., in a local environment) to connect to the Key Value instance."),
102-
mcp.WithToolAnnotation(mcp.ToolAnnotation{
103-
Title: "Get Key Value connection info",
104-
ReadOnlyHint: true,
105-
IdempotentHint: true,
106-
OpenWorldHint: true,
107-
}),
108-
mcp.WithString("keyValueId",
109-
mcp.Required(),
110-
mcp.Description("The ID of the Key Value store to retrieve"),
111-
),
112-
),
113-
Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
114-
if !config.IncludeSensitiveInfo() {
115-
return mcpserver.UnavailableDueToSensitiveInfoToolResult, nil
116-
}
117-
118-
keyValueId, err := validate.RequiredToolParam[string](request, "keyValueId")
119-
if err != nil {
120-
return mcp.NewToolResultError(err.Error()), nil
121-
}
122-
123-
connectionInfo, err := keyValueRepo.GetKeyValueConnectionInfo(ctx, keyValueId)
124-
if err != nil {
125-
return mcp.NewToolResultError(err.Error()), nil
126-
}
127-
128-
respJSON, err := json.Marshal(connectionInfo)
129-
if err != nil {
130-
return mcp.NewToolResultError(err.Error()), nil
131-
}
132-
133-
responseText := "Connection info: " + string(respJSON) + "\n\n"
134-
responseText += "Note: the cliCommand and externalConnectionString will not work "
135-
responseText += "correctly unless you have configured access controls to allow IP ranges "
136-
responseText += "from the machines you are using to connect. "
137-
138-
return mcp.NewToolResultText(responseText), nil
139-
},
140-
}
141-
}
142-
14393
func createKeyValue(keyValueRepo *Repo) server.ServerTool {
14494
return server.ServerTool{
14595
Tool: mcp.NewTool("create_key_value",

pkg/keyvalue/tools_test.go

Lines changed: 0 additions & 77 deletions
This file was deleted.

pkg/mcpserver/common.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package mcpserver
22

33
import (
4-
"github.com/mark3labs/mcp-go/mcp"
54
"github.com/render-oss/render-mcp-server/pkg/client"
65
pgclient "github.com/render-oss/render-mcp-server/pkg/client/postgres"
76
)
@@ -51,6 +50,3 @@ func EnumValuesFromClientType[T ~string](t ...T) []string {
5150
}
5251
return values
5352
}
54-
55-
var UnavailableDueToSensitiveInfoToolResult = mcp.NewToolResultText(
56-
"This tool is not available when sensitive info is disabled.")

pkg/postgres/tools.go

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ func Tools(c *client.ClientWithResponses) []server.ServerTool {
2121
return []server.ServerTool{
2222
listPostgresInstances(postgresRepo),
2323
getPostgres(postgresRepo),
24-
getPostgresConnectionInfo(postgresRepo),
2524
createPostgres(postgresRepo),
2625
queryPostgres(postgresRepo),
2726
}
@@ -94,53 +93,6 @@ func getPostgres(postgresRepo *Repo) server.ServerTool {
9493
}
9594
}
9695

97-
func getPostgresConnectionInfo(postgresRepo *Repo) server.ServerTool {
98-
return server.ServerTool{
99-
Tool: mcp.NewTool("get_postgres_connection_info",
100-
mcp.WithDescription("Retrieve connection info for a Postgres instance by ID. "+
101-
"Connection info includes sensitive information. \n\n"+
102-
"The returned internalConnectionString should be used as a connection string by "+
103-
"services within Render to connect to the Postgres instance. "+
104-
"The externalConnectionString should be outside of Render (e.g., in a local environment) to connect to the Postgres instance."),
105-
mcp.WithToolAnnotation(mcp.ToolAnnotation{
106-
Title: "Get Postgres connection info",
107-
ReadOnlyHint: true,
108-
IdempotentHint: true,
109-
OpenWorldHint: true,
110-
}),
111-
mcp.WithString("postgresId",
112-
mcp.Required(),
113-
mcp.Description("The ID of the Postgres instance to retrieve"),
114-
),
115-
),
116-
Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) {
117-
if !config.IncludeSensitiveInfo() {
118-
return mcpserver.UnavailableDueToSensitiveInfoToolResult, nil
119-
}
120-
121-
postgresId, err := validate.RequiredToolParam[string](request, "postgresId")
122-
if err != nil {
123-
return mcp.NewToolResultError(err.Error()), nil
124-
}
125-
126-
connectionInfo, err := postgresRepo.GetPostgresConnectionInfo(ctx, postgresId)
127-
if err != nil {
128-
return mcp.NewToolResultError(err.Error()), nil
129-
}
130-
131-
respJSON, err := json.Marshal(connectionInfo)
132-
if err != nil {
133-
return mcp.NewToolResultError(err.Error()), nil
134-
}
135-
responseText := "Connection info: " + string(respJSON) + "\n\n"
136-
responseText += "Note: the psql command and externalConnectionString will not work "
137-
responseText += "correctly unless you have configured access controls to allow IP ranges "
138-
responseText += "from the machines you are using to connect. "
139-
return mcp.NewToolResultText(responseText), nil
140-
},
141-
}
142-
}
143-
14496
func createPostgres(postgresRepo *Repo) server.ServerTool {
14597
return server.ServerTool{
14698
Tool: mcp.NewTool("create_postgres",

0 commit comments

Comments
 (0)