Skip to main content
Glama
WJS-WEB

CSL MCP Server

by WJS-WEB

CSL MCP Server

一个基于 Python + SQLite 的本地 MCP Server,用于把 CSL 中文科学文献数据集 封装成可被 Trae、MCP Inspector 或其他 MCP Client 调用的文献检索工具。

功能

当前版本提供以下 MCP Tools:

Tool

说明

search_papers

根据标题、摘要、关键词检索论文,支持门类和学科过滤

get_paper

根据论文 ID 获取单篇论文详情

list_categories

列出 CSL 数据库中的门类及数量

list_disciplines

列出 CSL 数据库中的学科及数量,可按门类过滤

get_dataset_statistics

查看本地 SQLite 数据库中的论文、门类、学科统计

当前版本还提供一个 MCP Resource:

Resource

说明

csl://dataset/info

查看 CSL 数据集和当前 MCP Server 的简要说明

Related MCP server: academic-mcp

项目结构

.
├── data/
│   └── csl.sqlite              # 导入后生成的本地 SQLite 数据库
├── src/
│   └── csl_mcp/
│       ├── __init__.py
│       ├── config.py           # 数据库路径配置
│       ├── database.py         # SQLite schema、连接和数据转换
│       ├── ingest.py           # CSL 数据导入脚本
│       ├── server.py           # MCP Server 入口和 tools 定义
│       └── service.py          # 文献检索和统计服务
├── mcp_config.example.json     # MCP Client 配置示例
├── pyproject.toml
└── README.md

环境要求

  • Python 3.10+

  • SQLite,Python 标准库已内置

  • MCP Python SDK

安装依赖:

cd D:\xm\CSL
pip install -e .

如果需要单独安装 MCP SDK:

pip install "mcp>=1.0.0"

下载 CSL Benchmark 数据

CSL benchmark 数据在官方仓库中,可以克隆完整仓库:

cd D:\xm
git clone https://github.com/ydli-ai/CSL.git CSL-source

benchmark 数据目录通常是:

D:\xm\CSL-source\benchmark

也可以只拉取 benchmark 目录:

cd D:\xm
git clone --filter=blob:none --sparse https://github.com/ydli-ai/CSL.git CSL-source
cd CSL-source
git sparse-checkout set benchmark

导入数据

将 CSL 数据导入到本地 SQLite:

cd D:\xm\CSL
python -m csl_mcp.ingest "D:\xm\CSL-source\benchmark" --db "D:\xm\CSL\data\csl.sqlite"

导入成功后会看到类似输出:

Imported 10000 records into D:\xm\CSL\data\csl.sqlite

导入脚本支持:

  • .json

  • .jsonl

  • .tsv

  • 包含以上文件的目录

对于 CSL benchmark 中的 text2text 格式,导入脚本会根据 prompt 做基础字段映射:

prompt

映射逻辑

to title

text_a 作为摘要,text_b 作为标题

to keywords

text_a 作为摘要,text_b 作为关键词

to category

text_a 作为标题,text_b 作为门类

to discipline

text_a 作为摘要,text_b 作为学科

在 MCP Inspector 中使用

启动 MCP Inspector 后,按以下方式配置:

配置项

Transport Type

STDIO

Command

python

Arguments

-m csl_mcp.server

环境变量:

Name

Value

PYTHONPATH

D:\xm\CSL\src

CSL_DB_PATH

D:\xm\CSL\data\csl.sqlite

然后点击 Connect

连接成功后可以测试:

{}

调用 get_dataset_statistics,或调用 search_papers

{
  "query": "文本分类",
  "limit": 5
}

在 Trae 中配置

可以参考 mcp_config.example.json

{
  "mcpServers": {
    "csl": {
      "command": "D:/xm/CSL/.venv/Scripts/python.exe",
      "args": [
        "-m",
        "csl_mcp.server"
      ],
      "env": {
        "PYTHONPATH": "D:/xm/CSL/src",
        "CSL_DB_PATH": "D:/xm/CSL/data/csl.sqlite"
      }
    }
  }
}

如果不使用虚拟环境,也可以把 command 改成:

"python"

配置完成后,可以在 Trae 中直接提问:

请用 csl 搜索“文本分类”相关论文,返回 5 篇。
请列出 CSL 数据库中的门类。
请查看 CSL 数据库统计信息。

直接启动说明

本项目的 MCP Server 使用 stdio transport。它不是普通命令行交互程序。

因此直接执行:

python -m csl_mcp.server

如果没有 MCP Client 向 stdin 发送合法 JSON-RPC 消息,可能会看到类似错误:

Invalid JSON: EOF while parsing a value

这是 stdio MCP Server 的正常表现。正确方式是由 Trae、MCP Inspector 或其他 MCP Client 启动它。

Tool 参数示例

search_papers

{
  "query": "文本分类",
  "limit": 5,
  "category": "工学",
  "discipline": "计算机科学与技术"
}

其中 categorydiscipline 可选。

get_paper

{
  "paper_id": "csl_00026194"
}

list_categories

{}

list_disciplines

{
  "category": "工学"
}

get_dataset_statistics

{}

当前实现说明

  • 使用 SQLite 保存论文元数据。

  • 使用 SQLite FTS5 建立基础全文检索索引。

  • categorydiscipline 建立普通索引。

  • keywords 在 SQLite 中以 JSON 字符串保存,返回时转换为数组。

  • limit 最大限制为 50,避免一次返回过多内容。

  • 查询结果统一使用:

{
  "ok": true,
  "data": {},
  "error": null
}

失败时:

{
  "ok": false,
  "data": null,
  "error": {
    "code": "PAPER_NOT_FOUND",
    "message": "Paper not found: csl_xxx"
  }
}

局限性

当前版本是本地 MVP,主要用于验证 MCP Server、SQLite 数据导入和基础检索流程。

已知限制:

  • SQLite FTS5 对中文分词能力有限。

  • 当前没有向量检索和语义召回。

  • 当前没有远程 HTTP/SSE transport。

  • 当前没有鉴权、审计和权限控制。

  • 当前主要面向 CSL benchmark 数据,完整 396k 数据需要额外下载后导入。

后续计划

  • 增加 --reset 导入参数和更详细导入统计。

  • 增加 sample_papers 工具。

  • 增加 similar_papers 工具。

  • 接入 FAISS / Qdrant 做语义检索。

  • 增加 hybrid search,将关键词检索和向量检索结合。

  • 增加 HTTP/SSE 部署模式。

  • 增加企业内部场景所需的鉴权、审计、限流和权限过滤。

参考

Available Tools

5 tools
get_dataset_statisticsA

Get CSL dataset statistics from the local SQLite database.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It implies a read operation ('get') and mentions the data source (local SQLite), but does not disclose performance characteristics, authorization needs, or side effects. For a simple retrieval tool, this is adequate but minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that immediately conveys the tool's purpose. No unnecessary words or details are present. It is front-loaded and earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the output schema exists, the description is not required to explain return values. However, the description is very brief and could hint at the type of statistics (e.g., counts, distributions). For a zero-parameter tool, this is passable but not fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, so schema coverage is 100%. The description need not add parameter details. The baseline for zero-parameter tools is 4, and the description meets that standard by not introducing confusion.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves 'CSL dataset statistics' from the 'local SQLite database', providing a specific verb and resource. It distinguishes from sibling tools (get_paper, list_categories, etc.) which focus on individual entities rather than dataset-level statistics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is given on when to use this tool versus alternatives. The description only states what it does, without mentioning prerequisites, context, or when not to use it. This forces the agent to infer usage from the tool's purpose alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_paperB

Get one CSL paper by id.

ParametersJSON Schema
NameRequiredDescriptionDefault
paper_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden for behavioral disclosure. It only states 'Get', implying read-only behavior but lacks details on error handling, rate limits, or any side effects. The presence of an output schema is not leveraged in description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single sentence with no extraneous words. However, it could be more informative without sacrificing conciseness. It is front-loaded but leaves gaps.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one parameter and an output schema, the description is functional but minimal. It does not mention what the tool returns (e.g., a paper object) or acknowledge the output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, requiring description to compensate. The description merely says 'by id' without explaining the paper_id format, length, or provenance. It adds no meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Get one CSL paper by id', specifying the verb, resource, and unique identifier. This distinguishes it from sibling tool search_papers which retrieves multiple papers.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool vs alternatives. While the context implies single-paper retrieval by ID, the description does not mention that search_papers is for queries or provide usage conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_categoriesA

List CSL categories with counts.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided. Description implies a read-only operation listing categories with counts, but does not disclose behaviors like caching, pagination, or authorization requirements. Minimal transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One concise sentence with no extraneous information. Every word contributes to the purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given zero parameters and an existing output schema (though not shown), the description is nearly complete. Minor gap: no mention of response structure, but output schema covers that.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, and schema coverage is 100% trivially. Description adds value by specifying that results include counts, which is beyond what the empty schema provides. Baseline 4 appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Specific verb 'List' with resource 'CSL categories' and qualifier 'with counts'. Clearly distinguishes from sibling tools like list_disciplines, as it targets categories specifically and provides count information.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool vs alternatives. Usage is implied from the name and purpose, but no when-not or alternative tools are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_disciplinesC

List CSL disciplines with counts. Optionally filter by category.

ParametersJSON Schema
NameRequiredDescriptionDefault
categoryNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It discloses it lists data with counts and optional filtering, but no mention of read-only nature, error conditions, or side effects. For a simple list operation, the minimal description is insufficient for full transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence that is front-loaded with the core action and result. No verbose or redundant text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has an output schema, so return values need not be described. However, for a list operation with optional filtering, the description lacks details on pagination, sorting, or what 'counts' means. It is minimally complete but could benefit from additional context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so description must compensate. It adds that 'category' is an optional filter, but does not explain valid values, format, or constraints like null handling. With one parameter, this is inadequate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'List' and the resource 'CSL disciplines', and specifies it returns 'counts'. The tool name 'list_disciplines' reinforces this. While it distinguishes from siblings like 'get_paper' and 'search_papers', the acronym 'CSL' is assumed known.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool versus alternatives like 'list_categories' or 'get_dataset_statistics'. The only usage hint is 'Optionally filter by category', which implies use cases but does not compare to other tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_papersC

Search CSL papers by title, abstract and keywords.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
queryYes
categoryNo
disciplineNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description carries the full burden. It only states 'Search' without revealing behavioral traits such as whether it is read-only, pagination behavior, authentication requirements, or result ordering. The description adds minimal transparency beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence that conveys the core purpose efficiently. There is no wasted content, though it could be slightly more structured with additional key behaviors.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 4 parameters (with 0% schema coverage) and an output schema (not visible), the description is too brief. It lacks information on pagination, result format, sorting, and filtering behavior. Sibling tools exist but are not mentioned, leaving gaps in completenss.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must compensate but only mentions searchable fields ('title, abstract and keywords'). It does not explain the meaning of 'limit', 'category', 'discipline', or how filters combine. The schema property titles are self-explanatory, but the description adds no deeper semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Search'), the resource ('CSL papers'), and the search fields ('by title, abstract and keywords'). It distinguishes from siblings like 'get_paper' (which retrieves a specific paper) and 'list_categories'/'list_disciplines' (which list metadata).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide guidance on when to use this tool versus alternatives. It neither lists exclusions nor explains scenarios where siblings would be more appropriate. The usage context is implied but not explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 5 tool updatesv0.1.0
    • First observedget_dataset_statistics
    • First observedget_paper
    • First observedlist_categories
    • First observedlist_disciplines
    • First observedsearch_papers

TDQS

A3.6/5.0
Disambiguation5/5

Each tool targets a distinct operation: statistics, single paper retrieval, categories, disciplines, and search. No overlap in purpose.

Naming Consistency5/5

All tools use consistent verb_noun pattern with snake_case (get_, list_, search_). Uniform and predictable.

Tool Count5/5

5 tools is well-scoped for a read-only CSL data server, covering statistics, lookup, listing, and search without overloading.

Completeness4/5

Covers core read operations (get, search, list) and statistics. Minor gaps like a bulk paper listing are covered by search, so no dead ends for typical queries.

Maintenance

ActivityStale
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    Not graded
    maintenance
    An MCP server for searching Chinese academic papers and core journal information across multiple free platforms like Baidu Scholar and the National Center for Philosophy and Social Sciences. It enables users to retrieve metadata for social science and STEM research papers without requiring API keys.
    -
  • A
    license
    A
    quality
    D
    maintenance
    Unified academic search MCP server that searches open literature (arXiv, bioRxiv, medRxiv, PMC), CNKI, and Web of Science, with browser-backed authentication, local paper library, and export to multiple formats.
    21
    2
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Multi-source academic paper search, citation graph exploration, and PDF download as an MCP server, designed for LLM agents doing research.
    6
    2
    Apache 2.0
  • A
    license
    Not graded
    quality
    D
    maintenance
    MCP server for searching academic papers via Google Scholar, retrieving metadata and abstracts, with support for Chinese queries and auto-translation.
    87
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/WJS-WEB/CSL_MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server