Skip to content

Commit 03ab015

Browse files
feat(mcp): add arXiv MCP server for academic paper search
- What: add arxiv-mcp-server to MCP tools list - What: add ARXIV_STORAGE_PATH env var for paper storage location - What: default storage path is ~/.arxiv-papers - What: add i18n translations for all locales (en, zh-TW, zh-CN, ja) - Why: enable AI assistants to search and download arXiv papers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 2092400 commit 03ab015

File tree

7 files changed

+30
-0
lines changed

7 files changed

+30
-0
lines changed

src/features/mcp_manager/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ pub struct EnvConfig {
44
pub github_host: Option<&'static str>,
55
pub context7_api_key: Option<&'static str>,
66
pub enable_cloudflare_mcp_raw: Option<&'static str>,
7+
pub arxiv_storage_path: Option<&'static str>,
78
}
89

910
impl EnvConfig {
@@ -16,6 +17,7 @@ impl EnvConfig {
1617
option_env!("enable_cloudflare_mcp"),
1718
option_env!("ENABLE_CLOUDFLARE_MCP"),
1819
),
20+
arxiv_storage_path: option_env!("ARXIV_STORAGE_PATH"),
1921
}
2022
}
2123

src/features/mcp_manager/tools.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,29 @@ pub fn get_available_tools(cli_type: CliType) -> Vec<McpTool> {
205205
},
206206
requires_interactive: false,
207207
},
208+
McpTool {
209+
name: "arxiv-mcp-server",
210+
display_name_key: keys::MCP_TOOL_ARXIV,
211+
install_args: {
212+
let storage_path = ENV_CONFIG
213+
.arxiv_storage_path
214+
.unwrap_or("~/.arxiv-papers");
215+
let mut args = vec!["arxiv-mcp-server".to_string()];
216+
if let Some(sep) = separator {
217+
args.push(sep.to_string());
218+
}
219+
args.extend(vec![
220+
"uv".to_string(),
221+
"tool".to_string(),
222+
"run".to_string(),
223+
"arxiv-mcp-server".to_string(),
224+
"--storage-path".to_string(),
225+
storage_path.to_string(),
226+
]);
227+
args
228+
},
229+
requires_interactive: false,
230+
},
208231
];
209232

210233
// 只有在環境變數存在時才加入特定工具

src/i18n/locales/en.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@
233233
"mcp.tool.cloudflare_casb" = "Cloudflare One CASB"
234234
"mcp.tool.cloudflare_graphql" = "Cloudflare GraphQL"
235235
"mcp.tool.tailwindcss" = "Tailwind CSS (Utility-first CSS)"
236+
"mcp.tool.arxiv" = "arXiv (Academic Paper Search & Download)"
236237

237238
"kubeconfig.header" = "Kubeconfig Window Isolation Manager"
238239
"kubeconfig.select_action" = "Select action"

src/i18n/locales/ja.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@
233233
"mcp.tool.cloudflare_casb" = "Cloudflare One CASB"
234234
"mcp.tool.cloudflare_graphql" = "Cloudflare GraphQL"
235235
"mcp.tool.tailwindcss" = "Tailwind CSS (CSS フレームワーク)"
236+
"mcp.tool.arxiv" = "arXiv (学術論文検索・ダウンロード)"
236237

237238
"kubeconfig.header" = "Kubeconfig ウィンドウ分離マネージャー"
238239
"kubeconfig.select_action" = "操作を選択"

src/i18n/locales/zh-CN.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@
233233
"mcp.tool.cloudflare_casb" = "Cloudflare One CASB"
234234
"mcp.tool.cloudflare_graphql" = "Cloudflare GraphQL"
235235
"mcp.tool.tailwindcss" = "Tailwind CSS (CSS 框架)"
236+
"mcp.tool.arxiv" = "arXiv (学术论文搜索与下载)"
236237

237238
"kubeconfig.header" = "Kubeconfig 窗口隔离管理器"
238239
"kubeconfig.select_action" = "请选择操作"

src/i18n/locales/zh-TW.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@
233233
"mcp.tool.cloudflare_casb" = "Cloudflare One CASB"
234234
"mcp.tool.cloudflare_graphql" = "Cloudflare GraphQL"
235235
"mcp.tool.tailwindcss" = "Tailwind CSS (CSS 框架)"
236+
"mcp.tool.arxiv" = "arXiv (學術論文搜尋與下載)"
236237

237238
"kubeconfig.header" = "Kubeconfig 視窗隔離管理器"
238239
"kubeconfig.select_action" = "請選擇操作"

src/i18n/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ pub mod keys {
389389
pub const MCP_TOOL_CLOUDFLARE_CASB: &str = "mcp.tool.cloudflare_casb";
390390
pub const MCP_TOOL_CLOUDFLARE_GRAPHQL: &str = "mcp.tool.cloudflare_graphql";
391391
pub const MCP_TOOL_TAILWINDCSS: &str = "mcp.tool.tailwindcss";
392+
pub const MCP_TOOL_ARXIV: &str = "mcp.tool.arxiv";
392393

393394
// Kubeconfig Manager
394395
pub const KUBECONFIG_HEADER: &str = "kubeconfig.header";

0 commit comments

Comments
 (0)