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 集成