Skip to content

Commit 2f41e2d

Browse files
committed
updates schema
1 parent 6c7b973 commit 2f41e2d

File tree

5 files changed

+32
-10
lines changed

5 files changed

+32
-10
lines changed

crates/chat-cli/src/cli/chat/prompt.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -745,10 +745,7 @@ mod tests {
745745
let key_event = KeyEvent(KeyCode::Char(key), Modifiers::CTRL);
746746

747747
// Try to bind and get the previous handler
748-
let previous_handler = test_editor.bind_sequence(
749-
key_event,
750-
EventHandler::Simple(Cmd::Noop)
751-
);
748+
let previous_handler = test_editor.bind_sequence(key_event, EventHandler::Simple(Cmd::Noop));
752749

753750
// If there was a previous handler, it means the key was already bound
754751
// (which could be our custom binding overriding Emacs)

crates/chat-cli/src/cli/chat/tools/custom_tool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl Default for TransportType {
4646
}
4747

4848
#[derive(Clone, Serialize, Deserialize, Debug, Eq, PartialEq, JsonSchema)]
49-
#[serde(tag = "type", rename_all = "camelCase", deny_unknown_fields)]
49+
#[serde(rename_all = "camelCase", deny_unknown_fields)]
5050
pub struct CustomToolConfig {
5151
/// The transport type to use for communication with the MCP server
5252
#[serde(default)]

crates/chat-cli/src/mcp_client/client.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ use crate::cli::chat::tools::custom_tool::{
6060
TransportType,
6161
};
6262
use crate::os::Os;
63-
use crate::util::directories::DirectoryError;
63+
use crate::util::directories::{
64+
DirectoryError,
65+
canonicalizes_path,
66+
};
6467

6568
/// Fetches all pages of specified resources from a server
6669
macro_rules! paginated_fetch {
@@ -524,7 +527,8 @@ impl McpClientService {
524527

525528
match r#type {
526529
TransportType::Stdio => {
527-
let command = Command::new(command_as_str).configure(|cmd| {
530+
let expanded_cmd = canonicalizes_path(os, command_as_str)?;
531+
let command = Command::new(expanded_cmd).configure(|cmd| {
528532
if let Some(envs) = config_envs {
529533
process_env_vars(envs, &os.env);
530534
cmd.envs(envs);

crates/chat-cli/src/mcp_client/oauth_util.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ pub async fn get_http_transport(
176176
os: &Os,
177177
url: &str,
178178
timeout: u64,
179-
scopes: &Vec<String>,
179+
scopes: &[String],
180180
headers: &HashMap<String, String>,
181181
auth_client: Option<AuthClient<Client>>,
182182
messenger: &dyn Messenger,
@@ -241,7 +241,7 @@ async fn get_auth_manager(
241241
url: Url,
242242
cred_full_path: PathBuf,
243243
reg_full_path: PathBuf,
244-
scopes: &Vec<String>,
244+
scopes: &[String],
245245
messenger: &dyn Messenger,
246246
) -> Result<AuthorizationManager, OauthUtilError> {
247247
let cred_as_bytes = tokio::fs::read(&cred_full_path).await;
@@ -298,7 +298,7 @@ async fn get_auth_manager(
298298

299299
async fn get_auth_manager_impl(
300300
mut oauth_state: OAuthState,
301-
scopes: &Vec<String>,
301+
scopes: &[String],
302302
messenger: &dyn Messenger,
303303
) -> Result<(AuthorizationManager, String), OauthUtilError> {
304304
let socket_addr = SocketAddr::from(([127, 0, 0, 1], 0));

schemas/agent-v1.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,27 @@
7373
"type": "string",
7474
"default": ""
7575
},
76+
"headers": {
77+
"description": "HTTP headers to include when communicating with HTTP-based MCP servers",
78+
"type": "object",
79+
"additionalProperties": {
80+
"type": "string"
81+
},
82+
"default": {}
83+
},
84+
"oauthScopes": {
85+
"description": "Scopes with which oauth is done",
86+
"type": "array",
87+
"items": {
88+
"type": "string"
89+
},
90+
"default": [
91+
"openid",
92+
"email",
93+
"profile",
94+
"offline_access"
95+
]
96+
},
7697
"command": {
7798
"description": "The command string used to initialize the mcp server",
7899
"type": "string",

0 commit comments

Comments
 (0)