feat(mcp): implement Prompts capability, Resources, and clean up daemon architecture

This commit is contained in:
Riz Ashraf committed 2026-09-22 21:41:17 +01:00
1 parent 9b9b403ef2
commit 251757f8fc
29 files changed
+1276 -182

No files matched your search

+125 -1
View File
@@ -605,7 +605,8 @@ pub async fn run_mcp_loop(app_name: &str, app_version: &str) {
app_name.clone(),
app_version.clone(),
))
.with_protocol_version(rmcp::model::ProtocolVersion::V_2024_11_05);
.with_protocol_version(rmcp::model::ProtocolVersion::V_2024_11_05)
.with_instructions(include_str!("instructions.md"));
send_response(JsonRpcResponse {
jsonrpc: "2.0".to_string(),
@@ -696,6 +697,129 @@ pub async fn run_mcp_loop(app_name: &str, app_version: &str) {
},
"required": ["code"]
}
},
{
"name": "nvim_open_file",
"description": "Safely opens a file in the active Neovim window",
"inputSchema": {
"type": "object",
"properties": {
"file": { "type": "string" },
"filetype": { "type": "string" }
},
"required": ["file"]
}
},
{
"name": "nvim_open_buffer",
"description": "Creates and opens a transient, scratch buffer that is not tied to a file on disk",
"inputSchema": {
"type": "object",
"properties": {
"name": { "type": "string" },
"content": { "type": "string" },
"filetype": { "type": "string" }
}
}
},
{
"name": "nvim_close_buffer",
"description": "Closes the current active buffer (or a specified buffer)",
"inputSchema": {
"type": "object",
"properties": {
"buf_id": { "type": "integer" },
"force": { "type": "boolean" }
}
}
},
{
"name": "nvim_split_window",
"description": "Opens a file or buffer in a split window alongside the current buffer",
"inputSchema": {
"type": "object",
"properties": {
"file": { "type": "string" },
"buf_id": { "type": "integer" },
"direction": { "type": "string", "enum": ["vertical", "horizontal"] }
}
}
},
{
"name": "nvim_reload_buffer",
"description": "Forces Neovim to reload the buffer from the filesystem, picking up external changes",
"inputSchema": {
"type": "object",
"properties": {
"buf_id": { "type": "integer" },
"force": { "type": "boolean" }
}
}
},
{
"name": "nvim_save_buffer",
"description": "Explicitly saves the current active buffer",
"inputSchema": {
"type": "object",
"properties": {}
}
},
{
"name": "nvim_set_quickfix",
"description": "Populates Neovim's quickfix list with search results, compile errors, or lint warnings",
"inputSchema": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"filename": { "type": "string" },
"lnum": { "type": "integer" },
"text": { "type": "string" }
},
"required": ["filename", "lnum", "text"]
}
},
"action": { "type": "string", "enum": ["replace", "append", "prepend"] }
},
"required": ["items"]
}
},
{
"name": "nvim_highlight_lines",
"description": "Temporarily or permanently highlights a block of code, or clears existing highlights.",
"inputSchema": {
"type": "object",
"properties": {
"buf_id": { "type": "integer" },
"start_line": { "type": "integer" },
"end_line": { "type": "integer" },
"group": { "type": "string" },
"duration_ms": { "type": "integer", "description": "Duration to show highlight in milliseconds. Set to 0 for permanent (until cleared manually)." },
"clear_only": { "type": "boolean", "description": "If true, will only clear existing highlights and ignore start/end lines." }
},
"required": ["start_line", "end_line"]
}
},
{
"name": "nvim_get_messages",
"description": "Retrieves the recent Neovim command-line messages, including warnings, error popups, and plugin outputs",
"inputSchema": {
"type": "object",
"properties": {
"tail": { "type": "integer" }
}
}
},
{
"name": "nvim_get_viewport",
"description": "Retrieves the exact range of lines currently visible on your screen",
"inputSchema": {
"type": "object",
"properties": {}
}
}
]
})),