• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nicholaswilde / aria2-mcp-rs / 22287475757

22 Feb 2026 11:13PM UTC coverage: 82.369% (-0.7%) from 83.048%
22287475757

push

github

nicholaswilde
chore: Bump version to 0.1.11

2733 of 3318 relevant lines covered (82.37%)

5.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/server/stdio.rs
1
use anyhow::Result;
2
use mcp_sdk_rs::server::Server;
3
use mcp_sdk_rs::transport::stdio::StdioTransport;
4
use std::sync::Arc;
5
use tokio::sync::RwLock;
6

7
use crate::aria2::notifications::Aria2Notification;
8
use crate::aria2::Aria2Client;
9
use crate::prompts::PromptRegistry;
10
use crate::resources::ResourceRegistry;
11
use crate::server::handler::McpHandler;
12
use crate::tools::ToolRegistry;
13

14
pub async fn run_server(
×
15
    registry: Arc<RwLock<ToolRegistry>>,
×
16
    resource_registry: Arc<RwLock<ResourceRegistry>>,
×
17
    prompt_registry: Arc<RwLock<PromptRegistry>>,
×
18
    clients: Vec<Arc<Aria2Client>>,
×
19
    mut notification_rx: tokio::sync::mpsc::Receiver<Aria2Notification>,
×
20
) -> Result<()> {
×
21
    let (transport, sender) = StdioTransport::new();
×
22
    let handler = Arc::new(McpHandler::new(
×
23
        registry,
×
24
        resource_registry,
×
25
        prompt_registry,
×
26
        clients,
×
27
    ));
28
    let server = Server::new(Arc::new(transport), handler);
×
29

30
    tokio::spawn(async move {
×
31
        while let Some(notification) = notification_rx.recv().await {
×
32
            let mcp_notification = notification.to_mcp_notification();
×
33
            // Try to deserialize into the transport's Message type
34
            match serde_json::from_value::<mcp_sdk_rs::transport::Message>(mcp_notification) {
×
35
                Ok(msg) => {
×
36
                    if let Err(e) = sender.send(Ok(msg)) {
×
37
                        log::error!("Failed to send notification to client: {}", e);
×
38
                    }
×
39
                }
40
                Err(e) => {
×
41
                    log::error!("Failed to serialize notification for transport: {}", e);
×
42
                }
43
            }
44
        }
45
    });
×
46

47
    server
×
48
        .start()
×
49
        .await
×
50
        .map_err(|e| anyhow::anyhow!("Server error: {:?}", e))?;
×
51
    Ok(())
×
52
}
×
53

54
#[cfg(test)]
55
mod tests {
56
    // We can't easily test run_server as it's blocking
57
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc