Documentation
¶
Overview ¶
Package mcpscope narrows the host MCP inventory to one role's servers for a native launch. See docs/claude-launch-identity.md.
Index ¶
- Variables
- func SkillName(server string) string
- func WriteSettings(dir, role, base string, allow []map[string]any, deny []string) (string, error)
- type Connector
- type Inventory
- type Selection
- func (sel Selection) Allowlist(home string) []map[string]any
- func (sel Selection) CodexOverrides() []string
- func (sel Selection) Connectors() []Connector
- func (sel Selection) DeniedTools() []string
- func (sel Selection) GooseArgs(keep []string, home string) ([]string, error)
- func (sel Selection) GooseOmitted() []string
- func (sel Selection) HeaderOmissions() []string
- func (sel Selection) OmittedSkills() []string
- func (sel Selection) OpenCodeConfig(home string) (string, error)
- func (sel Selection) Summary() string
- func (sel Selection) WriteClaude(dir, home string) (string, error)
- type Server
Constants ¶
This section is empty.
Variables ¶
var ErrNoInventory = errors.New("mcpscope: no MCP inventory")
ErrNoInventory marks an absent inventory, which leaves the launch unscoped.
Functions ¶
Types ¶
type Connector ¶ added in v2.210.0
Connector is a claude.ai connector that strict mode hides, so a granted role runs behind an allowlist. Deny holds tool names a grant keeps out, empty for full access.
func GrantedConnectors ¶ added in v2.214.0
GrantedConnectors are the shipped connectors a role holds, with no inventory read. The launch spec hands them to a launcher that renders the allowlist itself.
type Inventory ¶
Inventory is the parsed host inventory.
func Load ¶
Load reads an mcporter inventory and checks every role tag against roles, resolving retired slugs, so a renamed role cannot silently lose its servers.
type Selection ¶
type Selection struct {
Role string
Selected []string
Omitted []string
Scoped int // selected servers that carry a role tag
// contains filtered or unexported fields
}
Selection is one role's servers and the ones it leaves out.
func (Selection) Allowlist ¶ added in v2.210.0
Allowlist is the allowedMcpServers entry list that stands in for --strict-mcp-config: each selected server by URL or exact command, then each granted connector by URL.
func (Selection) CodexOverrides ¶
CodexOverrides disables each omitted server for one Codex launch, since the Codex registry is a shared host file that cannot hold a per-seat list.
func (Selection) Connectors ¶ added in v2.210.0
Connectors are the claude.ai connectors the role is granted.
func (Selection) DeniedTools ¶ added in v2.210.0
DeniedTools are the tool names the granted connectors keep out of the session.
func (Selection) GooseArgs ¶
GooseArgs replaces goose's configured extensions for one session with the role's servers, keeping the builtin and platform extensions named in keep.
func (Selection) GooseOmitted ¶ added in v2.211.0
GooseOmitted names the selected servers goose cannot reach, because its flag carries a URL and no header. The launch warns with them. COI-2639
func (Selection) HeaderOmissions ¶ added in v2.217.0
HeaderOmissions is one line per header left off the config, so the launch names the cause. The value is never read into the line.
func (Selection) OmittedSkills ¶ added in v2.200.0
OmittedSkills names the tool-reference skill of each server the role leaves out, so a session home does not list tools its harness never mounts.
func (Selection) OpenCodeConfig ¶
OpenCodeConfig is an inline config that defines the role's servers and turns off each omitted one, for OPENCODE_CONFIG_CONTENT. OpenCode merges it last.
type Server ¶
type Server struct {
Command string `json:"command"`
Args []string `json:"args"`
Env map[string]string `json:"env"`
Cwd string `json:"cwd"`
URL string `json:"url"`
BaseURL string `json:"baseUrl"`
Headers map[string]string `json:"headers"`
AOS struct {
Roles []string `json:"roles"`
} `json:"x-aos"`
}
Server is one inventory entry in mcporter's shape. Unknown keys are ignored.