jan/src-tauri/src/core/mcp/constants.rs
Dinh Long Nguyen e1c8d98bf2
Backend Architecture Refactoring (#6094) (#6162)
* add llamacpp plugin

* Refactor llamacpp plugin

* add utils plugin

* remove utils folder

* add hardware implementation

* add utils folder + move utils function

* organize cargo files

* refactor utils src

* refactor util

* apply fmt

* fmt

* Update gguf + reformat

* add permission for gguf commands

* fix cargo test windows

* revert yarn lock

* remove cargo.lock for hardware plugin

* ignore cargo.lock file

* Fix hardware invoke + refactor hardware + refactor tests, constants

* use api wrapper in extension to invoke hardware call + api wrapper build integration

* add newline at EOF (per Akarshan)

* add vi mock for getSystemInfo
2025-08-15 08:59:01 +07:00

47 lines
1.2 KiB
Rust

use std::time::Duration;
// MCP Constants
pub const MCP_TOOL_CALL_TIMEOUT: Duration = Duration::from_secs(30);
pub const MCP_BASE_RESTART_DELAY_MS: u64 = 1000; // Start with 1 second
pub const MCP_MAX_RESTART_DELAY_MS: u64 = 30000; // Cap at 30 seconds
pub const MCP_BACKOFF_MULTIPLIER: f64 = 2.0; // Double the delay each time
pub const DEFAULT_MCP_CONFIG: &str = r#"{
"mcpServers": {
"browsermcp": {
"command": "npx",
"args": ["@browsermcp/mcp"],
"env": {},
"active": false
},
"fetch": {
"command": "uvx",
"args": ["mcp-server-fetch"],
"env": {},
"active": false
},
"serper": {
"command": "npx",
"args": ["-y", "serper-search-scrape-mcp-server"],
"env": { "SERPER_API_KEY": "YOUR_SERPER_API_KEY_HERE" },
"active": false
},
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/path/to/other/allowed/dir"
],
"env": {},
"active": false
},
"sequential-thinking": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"],
"env": {},
"active": false
}
}
}"#;