编程笔记

lifelong learning & practice makes perfect

This article summarizes methods for jailbreaking LLM, focusing on techniques from the BEST-OF-N JAILBREAKING paper.总结了大模型越狱的方法,重点介绍了BEST-OF-N JAILBREAKING 论文和米斯特安全团队的Prompt越狱手册中的技术。

阅读全文 »

This article covers OpenAI's Responses API updates (MCP, image generation, code interpreter), Cline's Workflows and Rules, B站's Index-AniSora and Index-TTS models, the Awsome-Manus website, 砺算科技's GPU, and Q1 2025 China smartphone sales.文章介绍了OpenAI的API更新(MCP,Image Generation,Code解释器),Cline的工作流和规则,B站索引 - anisora和Index-TTS模型,Awsome-Manus网站,GPU和国内2025年Q1季度智能手机销量/市占率等数据。

阅读全文 »

A weekly summary of interesting links and topics, including a MCP translation tool, DeepLX, education resources, automotive regulations, and GitHub acceleration.

阅读全文 »

本文介绍了如何使用阿里云快照快速复制系统环境,以及如何解决使用自定义镜像后服务器始终显示“操作系统启动中”的问题。This article describes how to use Alibaba Cloud snapshots to quickly replicate a system environment, and how to solve the problem of the server always displaying 'Operating system starting' after using a custom image.

阅读全文 »

本文探讨 MCP 工具投毒实验及其安全影响。近日,MCP被发现存在工具投毒攻击(Tool Poisoning Attack,简称TPA)等风险,主要影响Cursor、Claude for Desktop等MCP客户端用户。工具投毒攻击的核心机制在于,攻击者可以在MCP代码注释中的工具描述里嵌入恶意指令,这些指令对用户不直接可见但对AI模型可见。这些隐藏指令可以操纵AI Agent执行未经授权的操作,例如读取敏感文件、泄露私密数据等。

阅读全文 »

使用mcp官方的python-sdk写个mcp server,在cline中使用

代码

源码已开源,详见mcp-sever

目前提供2个工具,封装jina.ai的api实现

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
@mcp.tool(name="fetch", description="使用 r.jina.ai 读取 URL 并获取其内容")
def fetch(url: str = Field(description="需要抓取的网页url")) -> str:
headers = {}
if JINA_API_KEY:
headers["Authorization"] = f"Bearer {JINA_API_KEY}"

try:
response = requests.get(
f"https://r.jina.ai/{url}",
headers=headers,
)
response.raise_for_status() # Raise HTTPError for bad responses (4xx or 5xx)
return response.text
except requests.exceptions.RequestException as e:
return f"Error fetching HTML: {e}"

安装

使用uv安装,配置时有个需要注意的点,即配置代码运行目录,否则需要配置环境变量 VIRTUAL_ENV

优先使用下面这种配置方式

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"mcpServers": {
"yiGmMk/mcp-server": {
"command": "uv",
"args": [
"--directory",
"/path/to/your/mcp-server",
"run",
"main.py"
],
"env": {
"JINA_API_KEY": "jina_api_key,请从https://jina.ai/reader获取",
"PYTHONIOENCODING": "utf-8"
},
"disabled": false,
"autoApprove": []
}
}
}

在cline中使用gemini-2.0-flash参考README文档就能完成安装mcp-server

效果

mcp-server,cline