Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(fs bashfs.FileSystem, opts ...Option) *mcp.Server
New creates an MCP server backed by the given filesystem.
func WithAuthIdentity ¶
func WithAuthIdentity(ctx context.Context, identity *AuthIdentityInfo) context.Context
WithAuthIdentity returns a copy of ctx carrying the resolved identity. The HTTP transport's auth middleware sets this after resolving a bearer token so downstream shell commands can read the caller's identity from the AUTH_SUBJECT / AUTH_NAME / AUTH_CLAIM_* environment variables.
Types ¶
type AuthIdentityInfo ¶
AuthIdentityInfo represents a resolved identity from a bearer token.
func AuthIdentityFromContext ¶
func AuthIdentityFromContext(ctx context.Context) (*AuthIdentityInfo, bool)
AuthIdentityFromContext returns the resolved identity stored on ctx, if any.
type AuthResolver ¶
type AuthResolver interface {
Resolve(token string) (*AuthIdentityInfo, error)
}
AuthResolver resolves bearer tokens into identities.
type Option ¶
type Option func(*serverConfig)
Option configures the MCP server.
func WithAuthResolver ¶
func WithAuthResolver(resolver AuthResolver) Option
WithAuthResolver configures the MCP server with an auth resolver.
func WithEnvVars ¶
WithEnvVars sets environment variables on the shell for every command execution.
func WithInstructions ¶
WithInstructions sets server instructions that are automatically injected into the client's context when it connects. This is the MCP-native way to teach clients how to use the server — no plugin or skill needed.
func WithServerName ¶
WithServerName overrides the MCP server name reported in the initialize response. This is what clients see in their connector list, so it should clearly describe what the server provides (e.g. "Company Knowledge Base").
func WithShellDescription ¶
WithShellDescription overrides the shell tool's description.