Skip to content

Commit 9f93e65

Browse files
Add documentation for MCP_DISABLE_EMBEDDED_RESOURCES feature flag
- Added Feature Flags section to server-configuration.md - Added troubleshooting note to Antigravity installation guide - Fixed linter issue in result_test.go - Generated updated documentation Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
1 parent 6bce2d5 commit 9f93e65

File tree

4 files changed

+57
-3
lines changed

4 files changed

+57
-3
lines changed

docs/installation-guides/install-antigravity.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ If you prefer running the server locally with Docker:
102102

103103
## Troubleshooting
104104

105+
### File contents not displaying properly
106+
107+
If you experience issues with the `get_file_contents` tool not displaying file contents correctly, this may be due to limited embedded resource support in some versions of Antigravity.
108+
109+
**Solution:** The remote GitHub MCP Server will soon support the `MCP_DISABLE_EMBEDDED_RESOURCES` feature flag to improve compatibility. This flag makes file contents return as standard MCP content types that work better across different clients.
110+
111+
For updates on this feature, see the [Server Configuration Guide](../server-configuration.md#feature-flags).
112+
105113
### "Error: serverUrl or command must be specified"
106114

107115
Make sure you're using `serverUrl` (not `url`) for the remote server configuration. Antigravity requires `serverUrl` for HTTP-based MCP servers.

docs/server-configuration.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,52 @@ See [Scope Filtering](./scope-filtering.md) for details on how filtering works w
345345

346346
---
347347

348+
## Feature Flags
349+
350+
The GitHub MCP Server supports runtime feature flags that can modify tool behavior for improved compatibility with different MCP clients.
351+
352+
### MCP_DISABLE_EMBEDDED_RESOURCES
353+
354+
**Purpose:** Improves compatibility with MCP clients that don't fully support embedded resources.
355+
356+
When enabled, the `get_file_contents` tool returns file content as standard MCP content types instead of embedded resources:
357+
- **Text files**: Returned as `TextContent` with MIME type in metadata
358+
- **Binary files**: Returned as `ImageContent` with base64-encoded data
359+
360+
**When to use:** Enable this flag if your MCP client has issues displaying or accessing file contents retrieved via `get_file_contents`.
361+
362+
**Configuration:**
363+
364+
<table>
365+
<tr><th>Remote Server</th><th>Local Server</th></tr>
366+
<tr valign="top">
367+
<td>
368+
369+
**Coming soon:** Remote server support for this flag will be available in the next release.
370+
371+
</td>
372+
<td>
373+
374+
Feature flags are checked at runtime via the feature flag checker. Configuration method depends on your deployment:
375+
376+
**For custom integrations:**
377+
```go
378+
featureChecker := func(ctx context.Context, flagName string) (bool, error) {
379+
if flagName == "MCP_DISABLE_EMBEDDED_RESOURCES" {
380+
return true, nil // Enable the flag
381+
}
382+
return false, nil
383+
}
384+
```
385+
386+
</td>
387+
</tr>
388+
</table>
389+
390+
> **Note:** This feature flag does not affect other tools, only `get_file_contents`. The default behavior (embedded resources) is maintained when the flag is not enabled, ensuring backward compatibility.
391+
392+
---
393+
348394
## Troubleshooting
349395

350396
| Problem | Cause | Solution |

pkg/github/repositories_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ func Test_GetFileContents_WithDisabledEmbeddedResourcesFlag(t *testing.T) {
519519
// Setup client with mock
520520
client := github.NewClient(tc.mockedClient)
521521
mockRawClient := raw.NewClient(client, &url.URL{Scheme: "https", Host: "raw.example.com", Path: "/"})
522-
522+
523523
// Create feature flag checker
524524
featureChecker := func(_ context.Context, flagName string) (bool, error) {
525525
if flagName == FeatureFlagDisableEmbeddedResources {

pkg/utils/result_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package utils
1+
package utils //nolint:revive //TODO: figure out a better name for this package
22

33
import (
44
"encoding/base64"
@@ -89,7 +89,7 @@ func TestNewToolResultResourceWithFlag_EnabledFlag_BinaryContent(t *testing.T) {
8989
// Second content should be ImageContent (not embedded resource)
9090
imageContent, ok := result.Content[1].(*mcp.ImageContent)
9191
require.True(t, ok, "Expected ImageContent but got %T", result.Content[1])
92-
92+
9393
// Data should be base64 encoded
9494
expectedBase64 := base64.StdEncoding.EncodeToString(binaryData)
9595
assert.Equal(t, []byte(expectedBase64), imageContent.Data)

0 commit comments

Comments
 (0)