Skip to main content
Glama

ServeMyAPI

by Jktfe

ServeMyAPI

个人 MCP(模型上下文协议)服务器,用于使用 macOS 钥匙串跨项目安全地存储和访问 API 密钥。

重要提示:ServeMyAPI 是一款 macOS 专用工具,依赖 macOS 钥匙串进行安全存储。它与 Windows 或 Linux 操作系统不兼容。更多详情,请参阅安全说明部分。

概述

ServeMyAPI 允许您将 API 密钥安全地存储在 macOS 钥匙串中,并通过一致的 MCP 接口访问它们。这让您可以轻松:

  • 安全地存储 API 密钥(它们在 .env 文件或配置文件中不可见)
  • 跨多个项目访问相同的密钥
  • 使用自然语言来存储和检索密钥(与 Claude 等 LLM 一起使用时)
  • 当您的人工智能助手需要访问服务时,直接向其提供密钥

为什么使用 ServeMyAPI 而不是 .ENV 文件?

使用 ServeMyAPI 代替传统的 .ENV 文件可以解决几个常见问题:

  1. GitHub 安全冲突
    • 为了安全起见,.ENV 文件需要从 Git 存储库中排除(通过 .gitignore)
    • 这会产生“隐藏上下文”问题,其中重要的配置对于合作者和 LLM 是不可见的
    • 新开发人员经常难以设置正确的环境变量
  2. LLM 整合挑战
    • 由于安全限制,像 Claude 这样的 LLM 无法直接访问你的 .ENV 文件
    • 当 LLM 需要 API 密钥来完成任务时,你通常需要手动解决方法
    • ServeMyAPI 让您的 AI 助手通过自然语言请求密钥
  3. 跨项目一致性
    • 使用 .ENV 文件,您通常需要在多个项目之间复制 API 密钥
    • 当密钥改变时,需要更新多个文件
    • ServeMyAPI 提供了一个可从任何项目访问的中央存储位置

这种方法为您提供了两全其美的效果:安全存储敏感凭据,同时又不牺牲 AI 工具的可见性和可访问性。

特征

  • 在 macOS 钥匙串中安全存储 API 密钥
  • 用于存储、检索、列出和删除密钥的简单 MCP 工具
  • 方便的 CLI 界面,用于基于终端的密钥管理
  • 支持 stdio 和 HTTP/SSE 传输
  • 与任何 MCP 客户端兼容(Claude Desktop 等)

安装

# Clone the repository git clone https://github.com/yourusername/servemyapi.git cd servemyapi # Install dependencies npm install # Build the project npm run build

用法

CLI 界面

ServeMyAPI 带有命令行界面,可直接从您的终端快速管理密钥:

# Install the CLI globally npm run build npm link # List all stored API keys api-key list # Get a specific API key api-key get github_token # Store a new API key api-key store github_token ghp_123456789abcdefg # Delete an API key api-key delete github_token # Display help api-key help

作为 stdio 服务器运行

这是将 ServeMyAPI 用作 MCP 服务器的最简单方法,尤其是在与 Claude Desktop 配合使用时:

npm start

作为 HTTP 服务器运行

对于需要 HTTP 访问的应用程序:

node dist/server.js

这将在端口 3000(或 PORT 环境变量中指定的端口)上启动服务器。

使用 Smithery

ServeMyAPI 可作为Smithery上的托管服务使用。

import { createTransport } from "@smithery/sdk/transport.js" const transport = createTransport("https://server.smithery.ai/@Jktfe/servemyapi") // Create MCP client import { Client } from "@modelcontextprotocol/sdk/client/index.js" const client = new Client({ name: "Test client", version: "1.0.0" }) await client.connect(transport) // Use the server tools with your LLM application const tools = await client.listTools() console.log(`Available tools: ${tools.map(t => t.name).join(", ")}`)

有关更多详细信息,请参阅Smithery API 文档

配置 MCP 客户端

ServeMyAPI 可与任何兼容 MCP 的客户端兼容。示例配置文件位于examples目录中。

克劳德桌面

要将 ServeMyAPI 与 Claude Desktop 结合使用:

  1. 找到或创建 Claude Desktop 配置文件:
    • macOS~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows%AppData%\Claude\claude_desktop_config.json
  2. 将 ServeMyAPI 添加到mcpServers部分(您可以从examples/claude_desktop_config.json复制):
    { "mcpServers": { "serveMyAPI": { "command": "node", "args": [ "/ABSOLUTE/PATH/TO/servemyapi/dist/index.js" ] } } }
  3. /ABSOLUTE/PATH/TO/servemyapi替换为 ServeMyAPI 安装的实际路径。
  4. 重新启动 Claude Desktop。
风帆冲浪

要将 ServeMyAPI 与 Windsurf 一起使用:

  1. 打开 Windsurf 编辑器并导航至“设置”
  2. 使用examples/windsurf_config.json中的示例将 ServeMyAPI 添加到您的 MCP 服务器配置中
  3. 调整路径以适应您的本地安装

MCP 工具

ServeMyAPI 公开了以下工具:

商店 API 密钥

将 API 密钥存储在钥匙串中。

参数:

  • name :API 密钥的名称/标识符
  • key :要存储的 API 密钥

示例(来自 Claude):

Using serveMyAPI, store my API key ABC123XYZ as "OpenAI API Key"

获取 API 密钥

从钥匙串中检索 API 密钥。

参数:

  • name :要检索的 API 密钥的名称/标识符

示例(来自 Claude):

Using serveMyAPI, get the API key named "OpenAI API Key"

删除 API 密钥

从钥匙串中删除 API 密钥。

参数:

  • name :要删除的 API 密钥的名称/标识符

示例(来自 Claude):

Using serveMyAPI, delete the API key named "OpenAI API Key"

列出 API 密钥

列出所有存储的 API 密钥。

无需任何参数。

示例(来自 Claude):

Using serveMyAPI, list all my stored API keys

安全说明

  • 所有 API 密钥都安全地存储在 macOS 钥匙串中
  • 只有当前用户可以访问密钥
  • 钥匙串需要身份验证才能访问
  • 没有以明文形式存储或记录任何密钥

路线图

ServeMyAPI 的未来计划包括:

  • 代码扫描工具:该工具可自动扫描代码库中的 API 端点、敏感 URL 和环境变量,并建议将其存储在 Keychain 中的名称。这将允许开发人员继续在其常规工作流程中使用 .ENV 文件,同时确保凭据在需要时也可供 LLM 和其他工具使用。
  • 跨平台支持:研究 Windows 和 Linux 的安全凭证存储选项,以使 ServeMyAPI 更广泛地被访问。
  • 与流行框架集成:提供与 Next.js、Express 等框架的轻松集成。
  • 密钥管理的 UI :一个简单的 Web 界面,用于直接管理您存储的 API 密钥。

欢迎通过提出问题或拉取请求来建议其他功能或为路线图做出贡献。

发展

# Run in development mode with hot reload npm run dev # Use the CLI during development npm run cli list # Lint the code npm run lint # Build for production npm run build

执照

麻省理工学院

-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

个人 MCP 服务器,使用 macOS Keychain 跨项目安全地存储和访问 API 密钥,让 AI 助手和应用程序通过自然语言检索凭据。

  1. 概述
    1. 为什么使用 ServeMyAPI 而不是 .ENV 文件?
      1. 特征
        1. 安装
          1. 用法
            1. CLI 界面
            2. 作为 stdio 服务器运行
            3. 作为 HTTP 服务器运行
            4. 使用 Smithery
            5. 配置 MCP 客户端
          2. MCP 工具
            1. 商店 API 密钥
            2. 获取 API 密钥
            3. 删除 API 密钥
            4. 列出 API 密钥
          3. 安全说明
            1. 路线图
              1. 发展
                1. 执照

                  Related MCP Servers

                  • A
                    security
                    A
                    license
                    A
                    quality
                    An MCP server that enables AI agents to authenticate with and interact with Open eClass platform instances, supporting UoA's SSO authentication system for retrieving course information and performing basic platform operations.
                    Last updated -
                    4
                    1
                    Python
                    MIT License
                  • A
                    security
                    F
                    license
                    A
                    quality
                    A Python implementation of an MCP server that enables secure, local Bitbucket integration for AI applications, providing tools for repository management, branch creation, file operations, issue tracking, and pull request creation.
                    Last updated -
                    10
                    3
                    Python
                    • Apple
                    • Linux
                  • -
                    security
                    -
                    license
                    -
                    quality
                    A MCP server that requires user authentication via Auth0, allowing it to call protected APIs on behalf of authenticated users.
                    Last updated -
                    TypeScript
                  • A
                    security
                    F
                    license
                    A
                    quality
                    An MCP server that allows AI assistants to interact with the ServiceTitan API, requiring client credentials for authentication.
                    Last updated -
                    454
                    TypeScript

                  View all related MCP servers

                  MCP directory API

                  We provide all the information about MCP servers via our MCP API.

                  curl -X GET 'https://glama.ai/api/mcp/v1/servers/Jktfe/serveMyAPI'

                  If you have feedback or need assistance with the MCP directory API, please join our Discord server