本指南聚焦于Node.js环境下的MCP服务器开发,为你提供详细步骤,助你快速搭建并配置服务器,以满足Claude Desktop的使用需求。
你可通过阅读以下链接中的内容,着手准备MCP服务器,以便供Claude Desktop使用。 https://modelcontextprotocol.io/quickstart/server#node
在项目目录下,执行以下命令进行依赖安装和项目构建:
npm install
npm run build
你需要在 env 中指定环境变量,修改配置后,请重启Claude Desktop。以下是配置文件示例:
{
"mcpServers": {
"aws-monthly-cost-report": {
"command": "node",
"args": [
"/path/to/aws-monthly-cost-report-mcp-server/build/index.js"
],
"env": {
"AWS_REGION": "ap-northeast-3",
"AWS_PROFILE": "default",
"AWS_S3_ENDPOINT": "https://s3.ap-northeast-3.amazonaws.com",
"AWS_COST_REPORT_BUCKET": "your-backet-name"
},
"disabled": false,
"autoApprove": [
"get_env"
]
}
}
}
你可以使用以下提示语与服务器进行交互:
告诉我这个月的AWS成本