Documentation
¶
Index ¶
- func GetExcludeTools(ctx context.Context) []string
- func GetGraphQLFeatures(ctx context.Context) []string
- func GetHeaderFeatures(ctx context.Context) []string
- func GetTokenScopes(ctx context.Context) ([]string, bool)
- func GetTools(ctx context.Context) []string
- func GetToolsets(ctx context.Context) []string
- func IsInsidersMode(ctx context.Context) bool
- func IsLockdownMode(ctx context.Context) bool
- func IsReadonly(ctx context.Context) bool
- func WithExcludeTools(ctx context.Context, tools []string) context.Context
- func WithGraphQLFeatures(ctx context.Context, features ...string) context.Context
- func WithHeaderFeatures(ctx context.Context, features []string) context.Context
- func WithInsidersMode(ctx context.Context, enabled bool) context.Context
- func WithLockdownMode(ctx context.Context, enabled bool) context.Context
- func WithMCPMethodInfo(ctx context.Context, info *MCPMethodInfo) context.Context
- func WithReadonly(ctx context.Context, enabled bool) context.Context
- func WithTokenInfo(ctx context.Context, tokenInfo *TokenInfo) context.Context
- func WithTokenScopes(ctx context.Context, scopes []string) context.Context
- func WithTools(ctx context.Context, tools []string) context.Context
- func WithToolsets(ctx context.Context, toolsets []string) context.Context
- type MCPMethodInfo
- type TokenInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetExcludeTools ¶
GetExcludeTools retrieves the excluded tools from the context
func GetGraphQLFeatures ¶
GetGraphQLFeatures retrieves GraphQL feature flags from the context
func GetHeaderFeatures ¶
GetHeaderFeatures retrieves the raw feature flags from context
func GetTokenScopes ¶
GetTokenScopes retrieves token scopes from the context
func GetToolsets ¶
GetToolsets retrieves the active toolsets from the context
func IsInsidersMode ¶
IsInsidersMode retrieves the insiders mode state from the context
func IsLockdownMode ¶
IsLockdownMode retrieves the lockdown mode state from the context
func IsReadonly ¶
IsReadonly retrieves the read-only mode state from the context
func WithExcludeTools ¶
WithExcludeTools adds the excluded tools to the context
func WithGraphQLFeatures ¶
withGraphQLFeatures adds GraphQL feature flags to the context
func WithHeaderFeatures ¶
WithHeaderFeatures stores the raw feature flags from the X-MCP-Features header into context
func WithInsidersMode ¶
WithInsidersMode adds insiders mode state to the context
func WithLockdownMode ¶
WithLockdownMode adds lockdown mode state to the context
func WithMCPMethodInfo ¶
func WithMCPMethodInfo(ctx context.Context, info *MCPMethodInfo) context.Context
WithMCPMethodInfo stores the MCPMethodInfo in the context.
func WithReadonly ¶
WithReadonly adds read-only mode state to the context
func WithTokenInfo ¶
WithTokenInfo adds TokenInfo to the context
func WithTokenScopes ¶
WithTokenScopes adds token scopes to the context
Types ¶
type MCPMethodInfo ¶
type MCPMethodInfo struct {
// Method is the MCP method being called (e.g., "tools/call", "tools/list", "initialize")
Method string
// ItemName is the name of the specific item being accessed (tool name, resource URI, prompt name)
// Only populated for call/get methods (tools/call, prompts/get, resources/read)
ItemName string
// Owner is the repository owner from tool call arguments, if present
Owner string
// Repo is the repository name from tool call arguments, if present
Repo string
// Arguments contains the raw tool arguments for tools/call requests
Arguments map[string]any
}
MCPMethodInfo contains pre-parsed MCP method information extracted from the JSON-RPC request. This is populated early in the request lifecycle to enable:
- Inventory filtering via ForMCPRequest (only register needed tools/resources/prompts)
- Avoiding duplicate JSON parsing in middlewares (secret-scanning, scope-challenge)
- Performance optimization for per-request server creation