Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,26 @@ import (
"github.com/render-oss/render-mcp-server/pkg/session"
)

const serverInstructions = `This server manages resources on Render (https://render.com).

Workspace selection is required before most actions. Tools that operate on services, ` +
"deploys, postgres databases, key-value stores, logs, or metrics need a workspace to be " +
"selected for the current session.\n\n" +
`Workspace flow:
1. If unsure whether a workspace is selected, call ` + "`get_selected_workspace`" + `.
2. If none is selected (or a tool returns a "no workspace selected" error), call ` +
"`list_workspaces`" + ` to see available workspaces.
3. Ask the user which workspace to use. NEVER pick one yourself — selecting the wrong ` +
`workspace can cause destructive actions on unintended resources.
4. Once the user confirms, call ` + "`select_workspace`" + ` with the matching ownerID, then ` +
`retry the original tool call.`

func Serve(transport string) *server.MCPServer {
// Create MCP server
s := server.NewMCPServer(
"render-mcp-server",
cfg.Version,
server.WithInstructions(serverInstructions),
)

c, err := client.NewDefaultClient()
Expand Down
7 changes: 6 additions & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ var defaultConfigPath string
const configPathEnvKey = "RENDER_CONFIG_PATH"
const workspaceEnvKey = "RENDER_WORKSPACE"

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")
var ErrNoWorkspace = errors.New("no workspace selected. To resolve: " +
"(1) call the `list_workspaces` tool to see the workspaces this account has access to, " +
"(2) ask the user which workspace to use — do NOT pick one yourself, since acting on the " +
"wrong workspace can cause destructive changes to unintended resources, " +
"(3) once the user confirms, call the `select_workspace` tool with the matching `ownerID`, " +
"then retry the original tool call")
var ErrLogin = errors.New("not authenticated; either set RENDER_API_KEY or ask your MCP host to authenticate")

type Config struct {
Expand Down