Smithery Ai Cookbook Python Quickstart

ai.smithery由 smithery.ai 發布官方發布者v1.13.1更新於 Oct 24, 2026

A simple MCP server built with FastMCP and python

發布方自己的服務:222wcnm Bilistalkermcp

已驗證Streamable HTTP可網頁執行開發者工具

概覽

AI 產生的概覽

以 FastMCP 與 Python 撰寫的最小範例伺服器,只提供一個字元計數工具,並以 Smithery 遠端端點形式執行。

可以做什麼
  • 統計字元:唯一的 count_character 工具回報指定字元在給定文字中出現的次數。
  • 作為教學範例:README 說明如何用 FastMCP 建置、執行並部署到 Smithery,並可用本機 Playground 檢視請求與回應。
適用情境
適合在學習如何建置與部署 FastMCP 伺服器時當作參考或連線測試,或驗證 MCP 用戶端能否連上遠端端點。除此之外沒有實際業務價值。
執行需求
遠端 streamable HTTP 端點(server.smithery.ai),需在 Authorization 標頭提供 bearer 權杖。若改在本機執行範例,則需要 Python 3.12 以上版本、uv 等 Python 套件管理工具,以及選用的 Node.js 與 npx(供 Smithery Playground 使用)。
安裝前請注意
必須驗證:Authorization 中的 bearer 權杖屬於機密,請勿寫入共用設定。此工具只讀取你傳入的文字,但送到託管端點的文字會離開本機。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Smithery Ai Cookbook Python Quickstart,將其新增到工作區。
  2. 連接 Authorization token 憑證。它們會被私密儲存,絕不會在公開頁面上展示。
  3. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/ai.smithery%2Fsmithery-ai-cookbook-python-quickstart/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "smithery-ai-cookbook-python-quickstart": {
      "type": "http",
      "url": "https://server.smithery.ai/@smithery-ai/cookbook-python-quickstart/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_TOKEN>"
      }
    }
  }
}

README

Character Counter MCP Server - Python Quickstart

A simple example of creating an MCP server using FastMCP and Python, designed to work with Smithery.

What This Does

This server provides a character counter tool called count_character that counts how many times a specific character appears in a given text. You'll test it using the Smithery Playground for interactive development.

Prerequisites

  • Python 3.12 or higher
  • A Python package manager (uv recommended, but pip, poetry, etc. also work)
  • Node.js and npx (optional, for Smithery Playground)

Quick Start

  1. Clone the repository:

    bash
    git clone https://github.com/smithery-ai/smithery-cookbook.gitcd smithery-cookbook/servers/python/quickstart
  2. Install dependencies:

    With uv (recommended):

    bash
    uv sync

    With poetry:

    bash
    poetry install

    With pip:

    bash
    pip install -r requirements.txt
  3. Run the server:

    You have two options:

    Option A: Just run the server

    bash
    # With uvuv run smithery dev# or use the shorter script alias:uv run dev
    # With poetrypoetry run smithery dev# or use the shorter script alias:poetry run dev
    # With pip (after installing dependencies)smithery dev

    This starts the MCP server on http://localhost:8081 and keeps it running.

    Option B: Run server + open playground (recommended for testing)

    bash
    # With uvuv run smithery playground# or use the shorter script alias:uv run playground
    # With poetrypoetry run smithery playground# or use the shorter script alias:poetry run playground
    # With pip (after installing dependencies)smithery playground

    This starts the MCP server AND automatically opens the Smithery Playground in your browser where you can:

    • Interact with your MCP server in real-time
    • Test the count_character tool with different text and characters
    • See the complete request/response flow
    • Debug and iterate on your MCP tools quickly

Testing the Character Counter

Try asking: "How many r's are in strawberry?"

  1. Deploy to Smithery: To deploy your MCP server:
    • Push your code to GitHub (make sure to include the smithery.yaml)
    • Connect your repository at https://smithery.ai/new

Your server will be available over HTTP and ready to use with any MCP-compatible client!

Stopping the Server

Press Ctrl+C in the terminal to stop the server.

來源:servers/python/quickstart/README.md,提交 2bf1e95

工具

0
SourceWeft 尚未讀取此伺服器的工具。

版本歷史

1
  1. v1.13.1最新Sep 16, 2026

評分

已滿足適用檢查項的 85%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Smithery 整合