内容
# sparql-mcp
Spring Boot MCP 服务器,执行针对 RDF 后端的 SPARQL 查询。
## 需求
- [mise](https://mise.jdx.dev/)
## 快速开始
```bash
mise trust
mise install
run
```
> [!TIP]
> 要启用任务/标志自动补全,请启用 `mise` shell 补全并安装 `usage`(文档:https://usage.jdx.dev/cli/completions)。
## 任务
使用以下命令列出所有可用任务:
```bash
mise tasks
```
示例:
```bash
mise build --clean --profile native native:compile
mise build --clean --profile native --native-image-name sparql-mcp-linux-x86_64 native:compile
```
## Shell 别名
在 shell 中激活 mise 后,您可以使用以下别名:
- `build` -> `mise run build`
- `run` -> `mise run build spring-boot:run`
- `build-test` -> `mise run build test`
- `build-package` -> `mise run build package`
- `build-native` -> `mise run build --profile native native:compile`
- `build-native-image` -> `mise run build --profile native spring-boot:build-image`
- `build-native-test` -> `mise run build --profile nativeTest test`
- `release` -> `mise run release`
## 版本控制
此存储库使用 `maven-git-versioning-extension`(`.mvn/extensions.xml`)。
- `pom.xml` 保留一个基本版本(`0.0.0-SNAPSHOT`)
- 有效的构建版本从 git refs/tags 导出
- 发布标签遵循 `v<semver>`(例如 `v0.1.0`)
## 发布
发布目前由以下命令触发:
```bash
mise release --push
```
工件和发布由 GitHub Actions + JReleaser 处理:
- 工作流:`.github/workflows/release.yml`
- 平台构建:`.github/workflows/reusable-assemble.yml`
- 分发模型:`jreleaser.yml` 中的 `BINARY`
工件按平台生成,名称唯一,然后附加到 GitHub 发布。
assemble 工作流将 Linux 容器镜像发布到临时注册表标签并记录其摘要。
最终发布作业将这些摘要提升到:
- `ghcr.io/kludgeworks/sparql-mcp:<version>`(用于 amd64 和 arm64 的 Linux 多架构清单)
- `ghcr.io/kludgeworks/sparql-mcp:<version>-linux-amd64`
- `ghcr.io/kludgeworks/sparql-mcp:<version>-linux-arm64`
## 备注
- 默认传输是 STDIO 上的 MCP(请参见 `application.yml`)。
- 运行时日志在用作 MCP stdio 服务器时不应写入 STDOUT。