MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / new

Method new

crates/opencode-mcp/src/client.rs:141–155  ·  view source on GitHub ↗
(server_name: String, tool_registry: Arc<McpToolRegistry>)

Source from the content-addressed store, hash-verified

139
140impl McpClient {
141 pub fn new(server_name: String, tool_registry: Arc<McpToolRegistry>) -> Self {
142 Self {
143 server_name,
144 transport: Mutex::new(None),
145 request_id: AtomicU64::new(0),
146 initialized: RwLock::new(false),
147 capabilities: RwLock::new(None),
148 tool_registry,
149 timeout_ms: 30000,
150 status: RwLock::new(McpStatus::Disabled),
151 oauth_manager: RwLock::new(None),
152 bus: None,
153 tools_changed: std::sync::atomic::AtomicBool::new(false),
154 }
155 }
156
157 pub fn with_timeout(mut self, timeout_ms: u64) -> Self {
158 self.timeout_ms = timeout_ms;

Callers

nothing calls this directly

Calls 1

newFunction · 0.85

Tested by

no test coverage detected