Class: Pikuri::Mcp::Registry::StdioEntry

Inherits:
Data
  • Object
show all
Defined in:
lib/pikuri/mcp/registry.rb

Overview

One local-subprocess MCP server's config: a unique id (the LLM's mcp_connect handle) and the argv to spawn it. command is an argv array (not a shell string) per Subprocess.spawn convention, even though the mcp gem owns the actual spawn (the "Subprocess seam" carve-out).

env is the stdio counterpart of HttpEntry's headers: — the right place for a server's auth token (+=> "..."+) rather than baking secrets into argv; the mcp gem merges it over what BundlerEnv hands it (this is the legitimate per-child credential channel of the "Environment is not a secret store" seam). Excluded from the cache fingerprint (Cache#transport_descriptor) so secrets never hit disk.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, command:, env: {}, private: false) ⇒ StdioEntry

Returns a new instance of StdioEntry.



48
49
50
# File 'lib/pikuri/mcp/registry.rb', line 48

def initialize(id:, command:, env: {}, private: false)
  super(id: id, command: command, env: env.freeze, private: private)
end

Instance Attribute Details

#commandArray<String> (readonly)

Returns argv to spawn the server, e.g. ["npx", "mcp-maven-deps"].

Returns:

  • (Array<String>)

    argv to spawn the server, e.g. ["npx", "mcp-maven-deps"].



47
48
49
50
51
# File 'lib/pikuri/mcp/registry.rb', line 47

StdioEntry = Data.define(:id, :command, :env, :private) do
  def initialize(id:, command:, env: {}, private: false)
    super(id: id, command: command, env: env.freeze, private: private)
  end
end

#envHash{String => String} (readonly)

Returns extra environment variables for the spawned process, merged over the de-bundlerized environment (BundlerEnv). Frozen. Defaults to an empty hash.

Returns:

  • (Hash{String => String})

    extra environment variables for the spawned process, merged over the de-bundlerized environment (BundlerEnv). Frozen. Defaults to an empty hash.



47
48
49
50
51
# File 'lib/pikuri/mcp/registry.rb', line 47

StdioEntry = Data.define(:id, :command, :env, :private) do
  def initialize(id:, command:, env: {}, private: false)
    super(id: id, command: command, env: env.freeze, private: private)
  end
end

#idString (readonly)

Returns short identifier the LLM uses to refer to this server, e.g. "gmail" or "maven-tools".

Returns:

  • (String)

    short identifier the LLM uses to refer to this server, e.g. "gmail" or "maven-tools".



47
48
49
50
51
# File 'lib/pikuri/mcp/registry.rb', line 47

StdioEntry = Data.define(:id, :command, :env, :private) do
  def initialize(id:, command:, env: {}, private: false)
    super(id: id, command: command, env: env.freeze, private: private)
  end
end

#privateBoolean (readonly)

Returns this server reaches data worth exfiltrating — a Notion workspace, a mail account, an internal wiki. Declared per entry because sensitivity is as unknowable to the framework here as it is for a filesystem: the person registering the server knows, and the one registering an open-data server knows too. Defaults to false, and feeds Pikuri::Mcp::Registry#private?.

Returns:

  • (Boolean)

    this server reaches data worth exfiltrating — a Notion workspace, a mail account, an internal wiki. Declared per entry because sensitivity is as unknowable to the framework here as it is for a filesystem: the person registering the server knows, and the one registering an open-data server knows too. Defaults to false, and feeds Pikuri::Mcp::Registry#private?.



47
48
49
50
51
# File 'lib/pikuri/mcp/registry.rb', line 47

StdioEntry = Data.define(:id, :command, :env, :private) do
  def initialize(id:, command:, env: {}, private: false)
    super(id: id, command: command, env: env.freeze, private: private)
  end
end