configure-mcp-server
关于
This skill configures MCP servers to connect Claude Code and Claude Desktop with tools like R via mcptools. It handles setup, Hugging Face integration, WSL paths, and multi-client configuration. Use it when establishing or troubleshooting MCP connectivity between Claude clients and various servers.
快速安装
Claude Code
推荐npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/configure-mcp-server在 Claude Code 中复制并粘贴此命令以安装该技能
技能文档
Configure MCP Server
Set up MCP server connections for Claude Code (WSL) + Claude Desktop (Windows).
Use When
- Setting up Claude Code to connect to R via mcptools
- Configuring Claude Desktop w/ MCP servers
- Adding Hugging Face or other remote MCP servers
- Troubleshooting MCP connectivity between tools
In
- Required: MCP server type (mcptools, Hugging Face, custom)
- Required: Client (Claude Code, Claude Desktop, or both)
- Optional: Auth tokens
- Optional: Custom server impl
Do
Step 1: Install MCP Server Packages
For R (mcptools):
install.packages("remotes")
remotes::install_github("posit-dev/mcptools")
For Hugging Face:
npm install -g mcp-remote
→ mcptools installs from GitHub + loads in R w/o errs. mcp-remote avail globally via which mcp-remote or npm list -g mcp-remote.
If err: mcptools → ensure remotes installed first. GitHub rate-limits install → set GITHUB_PAT in ~/.Renviron. mcp-remote → valid. Node.js + npm installed + on PATH.
Step 2: Configure Claude Code (WSL)
R mcptools server:
claude mcp add r-mcptools stdio \
"/mnt/c/Program Files/R/R-4.5.0/bin/Rscript.exe" \
-- -e "mcptools::mcp_server()"
Hugging Face server:
claude mcp add hf-mcp-server \
-e HF_TOKEN=your_token_here \
-- mcp-remote https://huggingface.co/mcp
Verify config:
claude mcp list
claude mcp get r-mcptools
→ claude mcp list shows both r-mcptools + hf-mcp-server (or whichever added). claude mcp get r-mcptools displays correct cmd + args.
If err: Server not in list → valid. ~/.claude.json contains correct entry. claude cmd not found → add to PATH: export PATH="$HOME/.claude/local/node_modules/.bin:$PATH".
Step 3: Configure Claude Desktop (Windows)
Edit %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"r-mcptools": {
"command": "C:\\PROGRA~1\\R\\R-45~1.0\\bin\\x64\\Rscript.exe",
"args": ["-e", "mcptools::mcp_server()"]
},
"hf-mcp-server": {
"command": "mcp-remote",
"args": ["https://huggingface.co/mcp"],
"env": {
"HF_TOKEN": "your_token_here"
}
}
}
}
Important: Use 8.3 short paths for Windows dirs w/ spaces (PROGRA~1 not Program Files). Use env vars for tokens, not --header args.
→ JSON config file at %APPDATA%\Claude\claude_desktop_config.json valid JSON w/ correct server entries. Claude Desktop shows MCP server indicators post-restart.
If err: Valid. JSON w/ linter (e.g., jq . < config.json). Use 8.3 short paths (PROGRA~1) if Windows path spaces cause parse errs. Ensure Claude Desktop fully restarted (not just minimized).
Step 4: Configure R Session for MCP
Add to project .Rprofile:
if (requireNamespace("mcptools", quietly = TRUE)) {
mcptools::mcp_session()
}
Starts MCP session auto when opening project in RStudio.
→ .Rprofile conditionally starts mcptools::mcp_session() when project opened in RStudio → MCP tools avail auto.
If err: mcptools not found at session start → valid. installed in library RStudio uses (check .libPaths()). Using renv → ensure mcptools in renv library.
Step 5: Verify Connections
Test R MCP from WSL:
"/mnt/c/Program Files/R/R-4.5.0/bin/Rscript.exe" -e "mcptools::mcp_server()"
Test from w/in Claude Code:
Start Claude Code + use MCP tools → they should appear in tool list.
Test Claude Desktop:
Restart Claude Desktop post-config changes. Check for MCP server indicators in UI.
→ Rscript w/ mcptools::mcp_server() produces out w/o errs. MCP tools appear in Claude Code tool list during active session. Claude Desktop shows server status post-restart.
If err: Rscript fails → check full path correct (ls "/mnt/c/Program Files/R/" to valid. R ver). Tools don't appear in Claude Code → restart session. Claude Desktop → check firewall.
Step 6: Multi-Server Configuration
Both Claude Code + Claude Desktop support multi MCP servers simultaneously:
# Claude Code: add multiple servers
claude mcp add r-mcptools stdio "/path/to/Rscript.exe" -- -e "mcptools::mcp_server()"
claude mcp add hf-mcp-server -e HF_TOKEN=token -- mcp-remote https://huggingface.co/mcp
claude mcp add custom-server stdio "/path/to/server" -- --port 3001
→ Multi MCP servers config'd + accessible simultaneously. claude mcp list shows all. Each server's tools avail in same Claude Code session.
If err: Servers conflict → check each has unique name in config. One server blocks others → valid. servers use non-blocking I/O (stdio transport handles auto).
Check
-
claude mcp listshows all config'd servers - R MCP server responds to tool calls
- Hugging Face MCP server auths + responds
- Both Claude Code + Claude Desktop can connect (if both config'd)
- MCP tools appear in tool list during sessions
Traps
- Windows path spaces: Use 8.3 short names or quote paths correct. Diff tools parse paths differently.
- Token in cmd args: Windows,
--header "Authorization: Bearer token"fails due to parsing. Use env vars instead. - Confuse Claude Code + Claude Desktop configs: Separate tools w/ separate config files (
~/.claude.jsonvs%APPDATA%\Claude\) - npx vs global install:
npx mcp-remotemay fail in Claude Desktop context. Install globally w/npm install -g mcp-remote. - mcptools ver: Ensure mcptools up to date. Requires
ellmerpkg as dep.
→
build-custom-mcp-server- creating your own MCP servertroubleshoot-mcp-connection- debugging connection issuessetup-wsl-dev-environment- WSL setup prerequisite
GitHub 仓库
相关推荐技能
qmd
开发这是一个本地搜索和索引的CLI工具,支持BM25、向量搜索和重排序功能。开发者可以用它快速索引本地文件(如Markdown文档)并进行混合搜索,特别适合代码库或文档的本地检索。它还提供MCP模式,能轻松集成到Claude开发环境中使用。
subagent-driven-development
开发该Skill用于在当前会话中执行包含独立任务的实施计划,它会为每个任务分派一个全新的子代理并在任务间进行代码审查。这种"全新子代理+任务间审查"的模式既能保障代码质量,又能实现快速迭代。适合需要在当前会话中连续执行独立任务,并希望在每个任务后都有质量把关的开发场景。
mcporter
开发mcporter Skill 让开发者能在Claude中直接管理和调用MCP服务器。它支持列出可用服务器、调用工具、处理OAuth认证以及管理服务器守护进程。开发者可以通过命令行式交互快速执行`mcporter list`查看服务器,或使用`mcporter call`直接调用工具,简化了MCP工作流程。
adk-deployment-specialist
开发这是一个用于部署和编排Google Vertex AI ADK智能体的Claude Skill,专为构建生产级多智能体系统而设计。它支持通过A2A协议进行智能体通信,提供代码执行沙箱和记忆库功能,并能处理智能体发现与任务提交。当开发者需要部署ADK智能体或编排多智能体协作时,可使用此Skill来简化Vertex AI Agent Engine的部署流程。
