feat(httpapi): expose default MCP instructions via /api/v1/status (MCP-2176)#652
Merged
Merged
Conversation
Add a `default_instructions` field to the /api/v1/status response carrying
the built-in default MCP instructions text (resolveInstructions("")), so the
Web UI instructions textarea can render the built-in default as its
placeholder without hardcoding the text (drift risk).
Wiring: add DefaultInstructions() to the httpapi ServerController interface,
implement it on *server.Server returning the defaultInstructions const, and
set response["default_instructions"] in handleGetStatus. The value is always
the built-in default, never the user's current custom value, so the
placeholder shows "what you'd get if you clear the box".
Tests: handler test asserts the status response includes a non-empty
default_instructions containing "retrieve_tools"; server-package test asserts
the controller method returns the built-in default.
Related #651 (frontend), MCP-2176, MCP-2175
Deploying mcpproxy-docs with
|
| Latest commit: |
cf1730f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://21dae766.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://feat-mcp-2176-status-default.mcpproxy-docs.pages.dev |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 27474831587 --repo smart-mcp-proxy/mcpproxy-go
|
Dumbris
added a commit
that referenced
this pull request
Jun 13, 2026
…651) Adds an editable textarea for the top-level `instructions` config to Settings → Advanced ("MCP server instructions" accordion), bound via the key-driven SettingsSection pattern. The built-in default is fetched live from `/api/v1/status` `default_instructions` and shown as the placeholder (no hardcoding, drift-safe). Empty-means-default: clearing persists `""`, which Go maps back to the built-in default. Frontend half of MCP-2175 (backend dependency #652 already merged). Verified end-to-end against a real running mcpproxy (no mocks): placeholder asserted exactly equal to the backend default, custom value saves+persists across reload, clearing falls back to the default. Report: frontend/verification/mcp-2175/report.html. All required checks green incl. qa-gate. Merged under explicit owner authorization (author == maintainer gh identity).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backend half of MCP-2175 (Web UI
instructionstextarea, frontend PR #651). Exposes the resolved built-in MCPinstructionsdefault via/api/v1/statusso the frontend renders it as the textarea placeholder without hardcoding the default text (drift risk — explicit issue requirement).What changed
internal/httpapi/server.goDefaultInstructions() stringto theServerControllerinterface.handleGetStatusnow setsresponse["default_instructions"] = s.controller.DefaultInstructions().internal/server/server.go(*Server).DefaultInstructions()returning the built-indefaultInstructionsconst (mirrorsresolveInstructions("")).The value is always the built-in default, never the user's current custom value, so the placeholder shows "what you'd get if you clear the box".
Why a controller method (not a direct import)
defaultInstructions/resolveInstructionsare unexported in packageserver, andinternal/serveralready importsinternal/httpapi— so a reverse import would create a cycle. The controller interface (already used by the handler) is the clean seam.Tests (TDD)
internal/httpapi/routing_test.go—TestHandleGetStatus_IncludesDefaultInstructions: asserts the status response includes a non-emptydefault_instructionscontainingretrieve_tools.internal/server/mcp_instructions_test.go—TestServer_DefaultInstructions: asserts the controller method returns the built-in default.baseController,MockServerController) gain the new method.Verification
go build ./...(personal edition) ✅./scripts/run-linter.sh→ 0 issues ✅go test ./internal/httpapi/... -race✅ andgo test ./internal/server/✅ (E2E need the built./mcpproxybinary)./scripts/test-api-e2e.sh→ 65/65 passed ✅/api/v1/status→default_instructionspresent (865 chars, containsretrieve_tools, real built-in text) ✅Docs / OAS
/api/v1/statusresponse data is a genericobject(no schema change required); no annotated contract changed, so no OAS regeneration needed.Handshake with frontend
Frontend PR #651 already consumes
default_instructionsand degrades gracefully when absent. Once this lands, the real default appears as the placeholder (route-mocked Playwrightplaceholder-default.spec.ts).Related #651, MCP-2176, MCP-2175