Class: ClaudeMemory::Commands::Initializers::McpConfigurator
- Inherits:
-
Object
- Object
- ClaudeMemory::Commands::Initializers::McpConfigurator
- Defined in:
- lib/claude_memory/commands/initializers/mcp_configurator.rb
Overview
Configures MCP server for ClaudeMemory
Instance Method Summary collapse
- #configure_global_mcp ⇒ Object
- #configure_project_mcp ⇒ Object
-
#initialize(stdout) ⇒ McpConfigurator
constructor
A new instance of McpConfigurator.
Constructor Details
#initialize(stdout) ⇒ McpConfigurator
Returns a new instance of McpConfigurator.
11 12 13 |
# File 'lib/claude_memory/commands/initializers/mcp_configurator.rb', line 11 def initialize(stdout) @stdout = stdout end |
Instance Method Details
#configure_global_mcp ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/claude_memory/commands/initializers/mcp_configurator.rb', line 30 def configure_global_mcp mcp_path = File.join(Dir.home, ".claude.json") existing = load_json_file(mcp_path) existing["mcpServers"] ||= {} existing["mcpServers"]["claude-memory"] = { "type" => "stdio", "command" => "claude-memory", "args" => ["serve-mcp"] } File.write(mcp_path, JSON.pretty_generate(existing)) @stdout.puts "✓ Configured MCP server in #{mcp_path}" end |
#configure_project_mcp ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/claude_memory/commands/initializers/mcp_configurator.rb', line 15 def configure_project_mcp mcp_path = ".claude.json" existing = load_json_file(mcp_path) existing["mcpServers"] ||= {} existing["mcpServers"]["claude-memory"] = { "type" => "stdio", "command" => "claude-memory", "args" => ["serve-mcp"] } File.write(mcp_path, JSON.pretty_generate(existing)) @stdout.puts "✓ Configured MCP server in #{mcp_path}" end |