Wisp Science基础入门:MCP

查看原文

做科研时,我们经常需要在不同工具之间来回切换:去 PubMed 查论文,到 GEO 找数据,再把结果整理进项目笔记。如果希望 AI 参与这些工作,就需要让它能够访问相应的数据源和工具。

MCP 提供了一套统一的连接方式。在 Wisp Science 中,你可以使用已有的科研连接器,也可以添加自己的 MCP 服务,让检索、读取和整理结果在同一段对话里完成。

这篇文章从概念讲起,再用两个例子介绍如何配置和验证连接。

先认识 MCP:让 AI 应用连接外部工具的通用协议。

MCP 的全称是 Model Context Protocol,模型上下文协议。它是一项开放标准,用来连接 AI 应用与外部系统,包括数据源、工具和工作流。MCP 官方用 USB-C 接口作比喻:设备通过统一接口连接,AI 应用也可以通过统一协议接入不同服务。MCP 官方介绍

放到 Wisp Science 里,可以这样理解各自的分工:

角色 负责什么
大模型 理解你的需求,选择工具,解读返回结果
Wisp Science 管理连接、组织工具调用、处理权限,并展示结果
MCP 服务 提供具体能力,例如读取网页、检索笔记或查询数据库

例如,你要求“查找某个研究方向的论文”,Wisp 可以把模型选定的检索请求交给相应工具,再让模型依据返回的记录整理结果。

MCP 规范中的服务端能力包括 Tools(工具)Resources(资源)Prompts(提示模板)。具体服务和客户端支持哪些能力,需要看各自实现;本文关注 Wisp 中最直接的用法:连接服务并调用工具。MCP 服务端能力说明

对科研用户来说,这意味着可以要求回答附上实际查到的 PMID、数据集编号和来源链接,方便后续核验。工具结果仍然需要结合原始记录和论文内容判断。

第一次使用,可以先试试 Wisp 内置的科研连接器。

Wisp Science 已有面向 PubMed、GEO、UniProt 等数据源的内置科研连接器。打开项目,进入 设置 → 连接,即可查看可用连接器,并按需要启用。

点击连接器名称,可以查看简介、数据来源和工具列表。展开某个工具,还能看到参数说明、必填项和默认值。具体覆盖范围可参阅项目的科研连接器清单

先确认已配置好可用模型,再试着发送这样一条消息:

请使用 PubMed 相关工具,检索 2024—2025 年关于植物单细胞转录组的论文,先整理 5 篇。请列出标题、年份、期刊、PMID 和来源链接,并用一句话概括研究对象。只收录工具实际返回的论文;检索失败时请说明原因。

你不需要记住工具名称。Wisp 内置 Agent 会先发现相关工具,再调用匹配的能力。把数据库、研究主题和需要的输出说清楚即可。

内置连接器已经随应用提供,访问上游数据库时仍需要网络;个别数据源也可能有凭据、额度或访问条件。

添加自定义 MCP 时,先判断对方提供的是“命令”还是“网址”。

统一入口是:设置 → 连接 → 添加连接

对方提供的配置 Wisp 中选择的类型 需要准备什么
uvx …npx … 等启动命令 本地命令 对应运行工具、启动参数,以及服务要求的环境变量
https://…/mcp 等服务端点 远程 URL MCP 地址,以及服务要求的登录授权或请求头

“本地命令”表示 Wisp 在本机启动一个 MCP 程序,通过标准输入输出与它通信。这个程序仍可能联网访问外部服务。

“远程 URL”表示 Wisp 连接一个已经运行的 MCP 服务。这里要填写服务商提供的 MCP 端点;服务官网首页和普通 API 地址通常不能直接使用。

下面两个例子可以按需要选择,不必全部配置。

本地命令示例:添加 Fetch 网页读取工具。

Fetch 是 MCP 官方示例仓库中的服务,可以读取网页并将内容转换为适合模型处理的文本。其文档提供了通过 uvx mcp-server-fetch 启动的配置方式。Fetch 使用说明

开始前,需要在电脑上安装 uv。可以参考 uv 官方安装说明,安装后在终端运行 uvx --version,确认命令可用。

随后打开 Wisp 的“添加连接”,填写:

字段 填写内容
名称 Fetch 网页读取
类型 本地命令
命令 uvx
参数 mcp-server-fetch
环境变量 此例通常可以留空

注意,命令和参数分开填写:“命令”框只填 uvx,“参数”框填 mcp-server-fetch

点击 测试,成功后再点击 保存,并确认连接处于启用状态。首次运行可能需要下载依赖,因此会比后续启动慢一些。

如果终端能找到 uvx,但 Wisp 提示找不到命令,可以把“命令”改为 uvx 可执行文件的完整路径。macOS/Linux 可用 command -v uvx 查询,Windows PowerShell 可用 (Get-Command uvx).Source 查询。

Windows 上若遇到编码相关异常,可以按 Fetch 文档在“环境变量”中添加:名称为 PYTHONIOENCODING,值为 utf-8

保存后,新建一段对话进行验证:

请使用“Fetch 网页读取”连接,读取 https://example.com ,告诉我网页标题和主要内容,并注明实际读取的网址。如果调用失败,请报告错误。

验证时,既要看工具调用是否成功,也要看回答是否依据返回内容。Fetch 适合读取网页文本,需要登录或依赖复杂页面交互的任务,应根据实际情况选择其他工具。

远程 URL 示例:连接 Notion。

如果你使用 Notion 管理研究笔记,可以连接它提供的远程 MCP 服务。Notion 官方提供的端点为 https://mcp.notion.com/mcp,通过 OAuth 授权访问工作区。Notion MCP 连接说明

在 Wisp 的“添加连接”中填写:

字段 填写内容
名称 Notion 研究笔记
类型 远程 URL
URL https://mcp.notion.com/mcp
认证方式 OAuth

点击 测试保存,Wisp 会按授权流程打开浏览器。登录后,按页面提示选择工作区并完成授权。测试不会保存连接,测试成功后仍需点击保存。

接着,新建一段对话:

请使用“Notion 研究笔记”连接,搜索标题包含“文献阅读”的页面,只返回页面标题和链接。

从搜索和读取开始,能比较容易确认授权范围是否符合预期。后续需要创建或更新笔记时,再明确目标页面和要写入的内容。

其他远程服务可能使用 API Key,而非 OAuth。这时按服务商文档填写“请求头”。例如,服务商要求 Bearer Token 时,添加名称为 Authorization 的请求头,其值填写 Bearer 你的实际密钥。这类手动请求头配置通常将认证方式选为“无”,表示不走 OAuth 流程;请求本身仍通过填写的请求头认证。

Wisp 会把连接级环境变量值、请求头值和 OAuth Token 保存在操作系统密钥环中。编辑已有连接时,密钥值留空会保留原值,删除对应行才会清除。完整操作说明见Wisp 基础配置教程

配置完成后,把“用什么、做什么、交付什么”写进任务。

Wisp 当前没有逐轮选择 MCP 的下拉框。连接是否可用,由当前项目的连接设置和已启用插件决定;在提示词里可以进一步说明本次任务希望使用的数据源。

例如,寻找公开数据时可以这样写:

请使用 GEO 相关工具,检索拟南芥根尖单细胞 RNA 测序公开数据。先列出候选数据集的 GSE 编号、研究主题、平台和来源链接,再说明各数据集与我的研究问题有什么关系。暂时只整理元数据。

或者,把检索结果整理成文件:

请使用 PubMed 相关工具检索植物根系细胞图谱论文,整理 10 篇候选文献。把标题、年份、PMID、链接和筛选理由保存为项目中的 Markdown 文件,并在对话中告诉我文件位置。

这里的检索由相关工具完成,整理和保存则可以结合 Wisp 的其他能力完成。同一项科研任务可以使用多个工具,不必由一个 MCP 包办所有步骤。

修改连接配置后,建议新建会话验证,避免旧会话尚未更新连接状态。需要停用某个服务时,在 设置 → 连接 关闭它,并新建会话或等待空闲 Agent 重建。工具详情中还可以设置“允许、询问、禁止”规则。

遇到问题,可以按出现的位置排查。

现象 优先检查
本地连接提示找不到命令 uv、Node 等依赖是否安装;必要时填写可执行文件完整路径
第一次测试一直等待 是否正在下载依赖;网络是否能访问所需的软件包来源
远程连接返回 401/403 授权是否完成、Token 是否有效、账号是否有目标资源权限
远程连接返回 404 是否填了正确的 MCP 端点,而非服务首页或普通 API 地址
测试成功,对话却未调用 是否已保存并启用;新建会话后,明确指定连接名称和任务
能列出工具,但具体查询失败 查看该次调用的错误,检查参数、资源权限、额度或上游服务状态

涉及代理时,可进入 设置 → 常规 → 网络,检查 MCP 服务对应的网络设置。已有连接需要重新连接后使用新值,本地 MCP 是否遵循代理环境变量还取决于服务自身实现。

第一次尝试,可以选一个熟悉的小任务:检索 5 篇论文、读取一个公开网页,或者搜索一篇自己的研究笔记。观察 Wisp 调用了什么工具、拿到了什么结果,再沿着这些结果继续提问,就能逐步把 MCP 用到自己的科研流程中。

本文依据撰写时的 Wisp Science 项目文档与界面实现整理;不同版本的界面文字可能略有差异。文中的任务提示词用于演示使用方式,不代表已经执行的检索结果。

Research often means switching between tools: PubMed for papers, GEO for datasets, and project notes for organizing results. To help with this work, an AI needs access to the relevant data sources and tools.

MCP provides a common way to connect them. In Wisp Science, you can use built-in research connectors or add your own MCP services so that searching, reading, and organizing results happen in the same conversation.

This tutorial introduces the concept, then uses two examples to configure and verify connections.

MCP connects AI applications to external tools.

MCP stands for Model Context Protocol, an open standard connecting AI applications to external systems such as data sources, tools, and workflows. Its official introduction compares it to USB-C: a common interface lets different systems connect. See the MCP introduction.

In Wisp, the responsibilities are:

Participant Responsibility
Language model Understand your request, select tools, and interpret results
Wisp Science Manage connections, organize calls, handle permissions, and display results
MCP service Provide capabilities such as webpage reading, note search, or database queries

For a literature request, Wisp can pass the model's chosen query to the appropriate tool, then let the model organize the returned records.

MCP server capabilities include Tools, Resources, and Prompts. Support depends on each server and client. This tutorial focuses on connecting services and calling tools. See MCP server capabilities.

For research, request actual PMIDs, dataset identifiers, and source URLs so you can verify them later. Tool output still needs to be evaluated against original records and papers.

Start with a built-in research connector.

Wisp includes connectors for sources such as PubMed, GEO, and UniProt. Open a project and go to Settings → Connections to inspect and enable them.

Click a connector to see its description, sources, and tool list. Expand a tool for parameters, required fields, and defaults. The research connector catalog describes coverage.

After configuring a working model, try:

Use the PubMed tools to find five papers from 2024–2025 on plant single-cell transcriptomics. List title, year, journal, PMID, and source URL, with one sentence about the study organism or material. Include only papers actually returned by the tools, and explain any search failure.

You do not need to memorize tool names. The built-in agent discovers relevant tools and calls a matching capability. Specify the database, research topic, and desired output.

Built-in connectors ship with the app, but accessing upstream databases still requires network access. Some sources also have credential, quota, or access requirements.

For a custom MCP service, identify whether you have a command or a URL.

Open Settings → Connections → Add connection.

Supplied configuration Connection type Prerequisites
A command such as uvx … or npx … Local command The launcher, arguments, and any required environment variables
A service endpoint such as https://…/mcp Remote URL The MCP endpoint and any required authorization or headers

A local command starts an MCP process on your computer and communicates over standard input and output. The process may still access online services.

A remote URL connects to an already-running MCP service. Enter the provider's MCP endpoint; a website homepage or ordinary API URL usually will not work.

Choose whichever example below is useful; you do not need both.

Local command example: add Fetch for reading webpages.

Fetch is a service in the official MCP examples repository. It reads webpages and converts them into text suitable for a model. Its documented launch command is uvx mcp-server-fetch. See the Fetch instructions.

Install uv following its official installation guide, then run uvx --version in a terminal to check that the command is available.

Fill in Add connection:

Field Value
Name Fetch webpage reader
Type Local command
Command uvx
Arguments mcp-server-fetch
Environment variables Usually empty for this example

Keep the command and arguments separate. Enter only uvx in Command and mcp-server-fetch in Arguments.

Click Test, then Save after success, and verify that the connection is enabled. The first run may download dependencies and take longer.

If a terminal finds uvx but Wisp cannot, enter its full executable path. Find it with command -v uvx on macOS/Linux or (Get-Command uvx).Source in Windows PowerShell.

For Windows encoding errors, the Fetch documentation suggests the environment variable PYTHONIOENCODING with value utf-8.

Save the connection and start a new conversation:

Use the Fetch webpage reader connection to read https://example.com. Report the page title, main content, and URL actually read. If the call fails, report the error.

Check both successful tool execution and whether the answer follows the returned content. Fetch is suited to webpage text; login-dependent or highly interactive tasks may need other tools.

Remote URL example: connect Notion.

If you keep research notes in Notion, you can connect its remote MCP service at https://mcp.notion.com/mcp, using OAuth for workspace authorization. See Notion's connection instructions.

Field Value
Name Notion research notes
Type Remote URL
URL https://mcp.notion.com/mcp
Authentication OAuth

Click Test or Save to follow the browser authorization flow. Sign in, choose the workspace, and authorize access. Testing does not save the connection; save it afterward.

In a new conversation, try:

Use Notion research notes to find pages with “Literature reading” in the title. Return only page titles and links.

Search and reading are useful initial checks of authorization scope. When you later want to create or update notes, specify the target page and the exact content.

Other remote services may use API keys instead of OAuth. Fill request headers according to their documentation. For a required Bearer token, use Authorization with value Bearer YOUR_ACTUAL_KEY. Such manual-header configurations normally select authentication None, meaning no OAuth flow; the header still authenticates the request.

Wisp stores connection-level environment values, header values, and OAuth tokens in the OS keyring. When editing, leaving an existing secret blank preserves it; removing its row clears it. See Basic Configuration.

Specify the source, task, and deliverable.

There is no per-turn MCP selector. Available connections depend on the current project's connection settings and enabled plugins. Your prompt can specify which source this task should use.

For public data:

Use GEO tools to find public single-cell RNA-seq datasets for Arabidopsis root tips. List candidate GSE identifiers, topics, platforms, and source URLs, then explain their relevance to my question. Only organize metadata for now.

For a saved literature list:

Use PubMed tools to find ten candidate papers on plant root cell atlases. Save titles, years, PMIDs, links, and screening reasons to a Markdown file in the project, then report its location.

The connector retrieves information; other Wisp tools can organize and save it. One research task can combine several tools without a single MCP service doing every step.

After changing connections, validate in a new session to avoid an older agent's connection state. Disable a service under Settings → Connections, then create a new session or wait for an idle agent rebuild. Tool details also offer Allow, Ask, and Deny permission rules.

Troubleshoot at the point of failure.

Symptom Check first
Local command not found Installed uv/Node dependencies; use an absolute executable path if needed
First test keeps waiting Dependency downloads and access to package sources
Remote 401 / 403 Completed authorization, valid token, and resource permissions
Remote 404 MCP endpoint rather than service homepage or ordinary API URL
Test succeeds but no tool is called Saved and enabled connection; new session with its name and a specific task
Tools are listed but a query fails Actual call error, parameters, permissions, quota, or upstream status

For proxies, check Settings → General → Network for MCP settings. Existing connections need to reconnect; whether a local MCP process honors proxy variables also depends on that service.

Start with a familiar small task: five papers, a public webpage, or a note search. Inspect the called tool and returned results, then continue from those results to build a useful research workflow.

This tutorial reflects Wisp documentation and implementation when written. Labels may vary by version. Example prompts demonstrate usage, not searches already executed.

返回教程目录