# OI-Wiki增强工具
## 基本信息
- Slug: `shwstone-mcp-oi-wiki`
- Source: modelscope
- Publisher: @ShwStone/mcp-oi-wiki
- Categories: vector-databases / education-and-learning-tools / rag-systems
- Hosted: No
- License: Unknown
- Source URL: https://www.modelscope.cn/mcp/servers/@ShwStone/mcp-oi-wiki
## 简介
通过利用OI-Wiki内容的向量搜索，增强大型语言模型的竞争编程知识，使模型能够检索相关的算法和技术。
## MCP Server 详情

# mcp-oi-wiki

Empower large models with the OI-Wiki boost!

![Multiplicative Inverse Search Result](./image.png)

## How does it work?

We use Deepseek-V3 to generate summaries of the current 462 pages on OI-wiki, embed these summaries as semantic vectors, and establish a vector database.

During queries, the closest vector in the database is found, and the corresponding wiki markdown is returned.

## Usage

Ensure you have `uv`.

First, download this repository:


cd <path of MCP servers>
git clone --recurse-submodules https://github.com/ShwStone/mcp-oi-wiki.git


Then, open your MCP configuration file (mcpo or claude):

json
{
  "mcpServers": {
    "oi-wiki": {
      "command": "uv",
      "args": [
        "--directory",
        "<path of MCP servers>/mcp-oi-wiki",
        "run",
        "python",
        "main.py"
      ]
    }
  }
}


## Update

You can generate your own `db/oi-wiki.db`.

Place your Silicon flow API key in the `api.key` file.

Then run:

sh
uv run script/request.py


Download the summary results to `result.jsonl` from the [batch inference page](https://cloud.siliconflow.cn/batches).

Finally, run:

sh
uv run script/gendb.py


This will generate a new `db/oi-wiki.db`.

## Thanks

- [milvus-io/milvus-lite: A lightweight version of Milvus](https://github.com/milvus-io/milvus-lite) for the vector database
- [OI-wiki/OI-wiki: :star2: Wiki of OI / ICPC for everyone. (A comprehensive online guide for a popular game, featuring cool arithmetic magic)](https://github.com/OI-wiki/OI-wiki) for OI-wiki
- [qdrant/fastembed: Fast, Accurate, Lightweight Python library to make State of the Art Embedding](https://github.com/qdrant/fastembed) for CPU-based vector embedding

