MCP Blog API

by tussanakorn
  • Linux
  • Apple
Integrations
  • Allows interaction with a mock blog API service, providing tools for fetching blogs, searching blogs by title, and adding new blog posts.

MCP 博客 API

一个使用 FastMCP 和 httpx 构建的简单博客 API 服务。该项目支持 uv,可实现快速、可靠的 Python 包管理和环境设置。

描述

该项目提供了一组 API 工具,用于与模拟博客 API 服务进行交互。它允许用户获取所有博客、按标题搜索博客以及添加新博文。该项目包含一个 uv.lock 文件,用于可复现的依赖项管理。

特征

  • 从模拟 API 获取所有博客
  • 按标题搜索博客
  • 添加新博客文章

要求

  • Python 3.13 或更高版本
  • httpx 0.28.1 或更高版本
  • mcp 1.9.0 或更高版本

安装

使用 uv(推荐)

# Clone the repository git clone https://github.com/yourusername/mcp-blog.git cd mcp-blog # Install dependencies with uv uv pip install -e .

使用 pip

# Clone the repository git clone https://github.com/yourusername/mcp-blog.git cd mcp-blog # Install dependencies pip install -e .

用法

# Import the MCP server from main import mcp # Get all blogs blogs = mcp.tools.get_blogs() # Search for blogs by title search_results = mcp.tools.search_blogs(query="Python") # Add a new blog new_blog = mcp.tools.add_blog(title="My New Blog", body="This is the content of my new blog post.")

运行服务器

使用 uv(推荐)

uv python main.py

使用标准 Python

python main.py

环境管理

使用 uv(推荐)

uv 为 Python 项目提供快速的环境管理。以下是为该项目创建和管理虚拟环境的方法:

# Create a new virtual environment uv venv # Activate the virtual environment # On Unix/macOS source .venv/bin/activate # On Windows .venv\Scripts\activate # Install dependencies in the virtual environment uv pip install -e . # Update dependencies uv pip sync

API 参考

获取博客()

从模拟 API 获取所有博客。

搜索博客(查询:str)

使用模拟 API 按标题搜索博客。

添加博客(标题:str,正文:str)

向模拟 API 添加新博客。

执照

[在此添加您的许可证信息]

贡献

[在此处添加贡献指南]

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

使用 FastMCP 构建的简单博客 API 服务,允许用户获取所有博客、按标题搜索博客以及添加新博客文章。

  1. 描述
    1. 特征
      1. 要求
        1. 安装
          1. 使用 uv(推荐)
          2. 使用 pip
        2. 用法
          1. 运行服务器
            1. 使用 uv(推荐)
            2. 使用标准 Python
          2. 环境管理
            1. 使用 uv(推荐)
          3. API 参考
            1. 获取博客()
            2. 搜索博客(查询:str)
            3. 添加博客(标题:str,正文:str)
          4. 执照
            1. 贡献

              Related MCP Servers

              • -
                security
                F
                license
                -
                quality
                A Python MCP server that enables semantic search through Search Labs blog posts indexed in Elasticsearch, allowing Claude to intelligently retrieve relevant information from the blog content.
                Last updated -
                Python
              • -
                security
                F
                license
                -
                quality
                An intermediary server that enables AI models to interact with Google's Blogger platform, automating the creation and management of blogs, posts, and labels through the Blogger API.
                Last updated -
                58
                1
                TypeScript
              • -
                security
                F
                license
                -
                quality
                A FastMCP-based service that provides stock data including historical prices, fundamental information, and financial news.
                Last updated -
                1
                Python
                • Linux
                • Apple
              • -
                security
                -
                license
                -
                quality
                A FastMCP server that enables browser automation through natural language commands, allowing Language Models to browse the web, fill out forms, click buttons, and perform other web-based tasks via a simple API.
                Last updated -
                1
                Python

              View all related MCP servers

              ID: u42ynrwl1f