You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fad555f
Browse filesBrowse the repository at this point in the historyBrowse files
`get-env` now masks the values of credential-like environment variables (names with a `KEY`, `TOKEN`, `SECRET`, `PASSWORD`, `PASSWD`, `CREDENTIAL`, `AUTH` or `COOKIE` segment) as `"<redacted>"`. Set `GET_ENV_INCLUDE_SECRETS=1` to return every value unmasked.
Copy file name to clipboardExpand all lines: src/everything/README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,8 @@ This MCP server attempts to exercise all the features of the MCP protocol. It is
13
13
14
14
A complete list of the registered MCP primitives and other protocol features demonstrated can be found in the [Server Features](docs/features.md) document.
15
15
16
+
The `get-env` tool returns the server's environment variables, but masks the value of any credential-like name (a `KEY`, `TOKEN`, `SECRET`, `PASSWORD`, `PASSWD`, `CREDENTIAL`, `AUTH` or `COOKIE` segment, such as `OPENAI_API_KEY`) as `"<redacted>"`. To see every value unmasked while debugging, start the server with `GET_ENV_INCLUDE_SECRETS=1` (or `true`). Leave it unset otherwise: with it set, every credential in the server's environment reaches the model's context.
17
+
16
18
## Protocol versions
17
19
18
20
The server serves both protocol eras, over stdio and Streamable HTTP, from one process:
Copy file name to clipboardExpand all lines: src/everything/docs/features.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ Each feature below is marked **both**, **2026-07-28** or **2025-era**. Roots, sa
31
31
32
32
-`echo` (tools/echo.ts), **both**: Echoes the provided `message: string`. Uses Zod to validate inputs.
33
33
-`get-annotated-message` (tools/get-annotated-message.ts), **both**: Returns a `text` message annotated with `priority` and `audience` based on `messageType` (`error`, `success`, or `debug`); can optionally include an annotated `image`.
34
-
-`get-env` (tools/get-env.ts), **both**: Returns all environment variables from the running process as pretty-printed JSON text.
34
+
-`get-env` (tools/get-env.ts), **both**: Returns all environment variables from the running process as pretty-printed JSON text. Every name is returned, but the value of a credential-like name (one with a `KEY`, `TOKEN`, `SECRET`, `PASSWORD`, `PASSWD`, `CREDENTIAL`, `AUTH` or `COOKIE` segment between underscores, in any case) is replaced with `"<redacted>"`. Set `GET_ENV_INCLUDE_SECRETS=1` (or `true`) in the server's environment to return every value unmasked, for debugging.
35
35
-`get-header-params` (tools/get-header-params.ts), **both**: Returns its `region` argument and the `Mcp-Param-Region` HTTP header it arrived in. Its input and output schemas are plain JSON Schema 2020-12, and `region` carries `x-mcp-header: "Region"`, so a 2026-07-28 Streamable HTTP client mirrors it into that header and the server refuses a call whose header disagrees with the body (`-32020`). The header is `null` on stdio and for a 2025-era client.
36
36
-`get-resource-links` (tools/get-resource-links.ts), **both**: Returns an intro `text` block followed by multiple `resource_link` items. For a requested `count` (1–10), alternates between dynamic Text and Blob resources using URIs from `resources/templates.ts`.
37
37
-`get-resource-reference` (tools/get-resource-reference.ts), **both**: Accepts `resourceType` (`text` or `blob`) and `resourceId` (positive integer). Returns a concrete `resource` content block (with its `uri`, `mimeType`, and data) with surrounding explanatory `text`.
Copy file name to clipboardExpand all lines: src/everything/docs/instructions.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,7 @@ The server serves two protocol eras. A client on protocol version 2026-07-28 con
20
20
## Constraints & Limitations
21
21
22
22
-`gzip-file-as-resource`: Max fetch size controlled by `GZIP_MAX_FETCH_SIZE` (default 10MB), timeout by `GZIP_MAX_FETCH_TIME_MILLIS` (default 30s), allowed domains by `GZIP_ALLOWED_DOMAINS`
23
+
-`get-env`: Values of credential-like variable names (`*_KEY`, `*_TOKEN`, `*_SECRET`, `*_PASSWORD` and the like) come back as `"<redacted>"`; the server operator can set `GET_ENV_INCLUDE_SECRETS=1` to return them unmasked
23
24
- Session resources are ephemeral and lost when the session ends; minted resources expire after ten minutes
24
25
- Roots, sampling and logging are deprecated as of protocol version 2026-07-28, as is the HTTP+SSE transport
Copy file name to clipboardExpand all lines: src/everything/docs/structure.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -168,7 +168,7 @@ src/everything
168
168
-`get-annotated-message.ts`
169
169
- Registers a `get-annotated-message` tool which demonstrates content-level annotations. Emits a primary `text` message with content `annotations` (`priority`, `audience`) that vary by `messageType` (`"error" | "success" | "debug"`), and optionally includes an annotated `image` (tiny PNG) when `includeImage` is true. All tools in this server include tool-level annotations (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`).
170
170
-`get-env.ts`
171
-
- Registers a `get-env` tool that returns the current process environment variables as formatted JSON text; useful for debugging configuration.
171
+
- Registers a `get-env` tool that returns the current process environment variables as formatted JSON text; useful for debugging configuration. Values of credential-like names are masked as `"<redacted>"` unless `GET_ENV_INCLUDE_SECRETS` is set to a truthy value.
172
172
-`get-header-params.ts`
173
173
- Registers a `get-header-params` tool with JSON Schema 2020-12 input and output schemas whose `region` argument carries `x-mcp-header`; returns the argument and the `Mcp-Param-Region` header it arrived in.
/** Name segments that mark a variable as holding a credential. */
27
+
constCREDENTIAL_SEGMENTS=newSet([
28
+
"KEY",
29
+
"TOKEN",
30
+
"SECRET",
31
+
"PASSWORD",
32
+
"PASSWD",
33
+
"CREDENTIAL",
34
+
"AUTH",
35
+
"COOKIE",
36
+
]);
37
+
38
+
/** Values of `GET_ENV_INCLUDE_SECRETS` that turn the opt-in on. */
39
+
constTRUTHY=newSet(["1","true","yes","on"]);
40
+
3
41
// Tool configuration
4
42
constname="get-env";
5
43
constconfig={
6
44
title: "Print Environment Tool",
7
45
description:
8
-
"Returns all environment variables, helpful for debugging MCP server configuration",
46
+
"Returns all environment variables, helpful for debugging MCP server configuration. "+
47
+
`Values of credential-like names (a KEY, TOKEN, SECRET, PASSWORD, PASSWD, CREDENTIAL, AUTH or COOKIE name segment) are masked as "${REDACTED}" unless ${INCLUDE_SECRETS_VAR} is set to 1 or true in the server's environment.`,
9
48
inputSchema: {},
10
49
annotations: {
11
50
readOnlyHint: true,
@@ -15,11 +54,55 @@ const config = {
15
54
},
16
55
};
17
56
57
+
/**
58
+
* Whether an environment variable name looks like it holds a credential:
59
+
* one of its underscore-separated segments, compared case-insensitively, is
60
+
* a credential word.
61
+
*
62
+
* @param {string} key - The environment variable name.
63
+
* @returns {boolean} True when the value should be masked.
0 commit comments