Token导航 LogoToken导航TokenDH.com
nsip (Zircote) logo
开发工具未说明官方级别未说明来源级核验

nsip (Zircote)

MCP Server

一个用于绵羊遗传评估的CLI和MCP服务器工具,提供动物搜索、EBV比较、交配规划和羊群排名等功能。

工具数

13

提示词数

0

GitHub Stars

1

资源数

0
RustClaude开发工具ClaudeVS Code

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

zircote

提供方

zircote

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

nsip

](https://github.com/zircote/nsip) ![CI](https://github.com/zircote/nsip/actions/workflows/ci.yml) ![Crates.io](https://crates.io/crates/nsip) ![Documentation](https://docs.rs/nsip) ](https://www.rust-lang.org/) ![License](https://github.com/zircote/nsip/blob/main/LICENSE) ![Clippy](https://github.com/rust-lang/rust-clippy) ![cargo-deny](https://github.com/EmbarkStudios/cargo-deny) ![Security: gitleaks](https://github.com/gitleaks/gitleaks) ![Dependabot](https://docs.github.com/en/code-security/dependabot)

绵羊遗传评估CLI和MCP服务器——通过NSIP数据库搜索动物、比较EBV、计划交配、对羊群进行排名。

试试看: 克隆 zircote/nsip示例 用于预配置MCP服务器配置、示例工作流和AI助手指令的即用型农场存储库。

特性

  • 类型安全的API客户端 具有全面的错误处理功能
  • 搜索功能 按品种组、状态和其他标准对动物进行分类
  • 详细的动物信息 包括血统和后代
  • MCP(模型上下文协议)集成 AI助手兼容性
  • CLI工具 具有多个子命令,便于交互
  • 异步/等待支持 使用tokio运行时
  • 完整文档 所有公共API中都有示例

安装

将此添加到您的 Cargo.toml:

[dependencies]
nsip = "0.4"

或使用货物添加:

cargo add nsip

快速开始

use nsip::{NsipClient, SearchCriteria};

#[tokio::main]
async fn main() -> Result {
    // Create a new client
    let client = NsipClient::new();

    // List available breed groups
    let breed_groups = client.breed_groups().await?;
    println!("Available breed groups: {}", breed_groups.len());

    // Search for animals
    let criteria = SearchCriteria::new()
        .with_status("CURRENT");

    let results = client
        .search_animals(0, 15, Some(640), None, None, Some(&criteria))
        .await?;
    println!("Found {} animals", results.total_count);

    // Get details for a specific animal
    let animal = client.animal_details("LPN_ID_HERE").await?;
    println!("Animal: {}", animal.lpn_id);

    Ok(())
}

CLI使用情况

nsip CLI提供了几个用于与NSIP Search API交互的命令:

# Get database last-updated date
nsip date-updated

# List breed groups
nsip breed-groups

# List animal statuses
nsip statuses

# Get trait ranges for a breed
nsip trait-ranges 640

# Search for animals
nsip search --breed-id 640 --status CURRENT --page 0 --page-size 15

# Get animal details
nsip details 

# Get animal lineage
nsip lineage 

# Get animal progeny
nsip progeny 

# Get full profile (details + lineage + progeny)
nsip profile 

# Compare two or more animals side-by-side
nsip compare  

# Generate shell completions
nsip completions bash

# Generate man pages
nsip man-pages ./man/

# Start MCP server mode
nsip mcp

API概述

客户端方法

方法说明
date_last_updated()获取数据库上次更新日期
breed_groups()列出可用的品种组
statuses()列出可用的动物状态
trait_ranges(breed_id)获取品种的特征范围
search_animals(page, page_size, breed_id, sorted_trait, reverse, criteria)寻找动物
animal_details(search_string)获取动物详细信息
lineage(lpn_id)获得动物血统
progeny(lpn_id, page, page_size)获取动物后代
search_by_lpn(lpn_id)获取完整配置文件(并发)

数据类型

类型描述
NsipClientAPI主要客户
SearchCriteria使用生成器模式搜索参数
AnimalDetails详细的动物记录,包括特征和联系方式
AnimalProfile组合细节+血统+后代
Breed同一品种组中的单一品种
BreedGroup嵌套品种的品种组
ContactInfo所有者/羊群联系信息
DateLastUpdated从上次更新端点的日期开始的响应
Lineage动物谱系/祖先树
LineageAnimal谱系树中的单个节点
Progeny分页动物后代
ProgenyAnimal单胎记录
SearchResults分页搜索结果
Trait具有价值和准确性的单一EBV性状
TraitRange品种内性状的最小/最大范围
TraitRangeFilter特征过滤器的最小/最大界限
Error操作的错误类型
Result键入别名 Result

MCP集成

该库包括MCP(模型上下文协议)支持,用于与AI助手集成:

use nsip::mcp::{serve_stdio, tool_sets::EnabledToolSets};

// Start the MCP server on stdio (all 13 tools enabled)
serve_stdio(EnabledToolSets::all()).await?;

MCP协议在运行时公开了以下13个工具 nsip mcp:

  • search -使用品种、性别、状态、日期范围和羊群过滤器搜索动物
  • details -获取动物的详细EBV数据、品种、联系信息和状态
  • lineage -获取家谱/祖先树,包括父母和祖父母
  • progeny -获取动物后代的分页列表
  • profile -一次通话即可获取完整的个人资料(详细信息+血统+后代)
  • breed_groups -列出所有品种组和单个品种
  • trait_ranges -获取特定品种的最小/最大EBV性状范围
  • compare -并排比较2-5只动物的EBV特征
  • rank -根据加权EBV特征对同一品种内的动物进行排名
  • inbreeding_check -计算父女配对的赖特近亲繁殖系数
  • mating_recommendations -根据特征互补性和COI找到最佳伴侣
  • flock_summary -总结一群动物:计数、性别分类和平均EBV
  • database_status -获取最后更新日期和可用动物状态

发展

先决条件

设置

# Clone the repository
git clone https://github.com/zircote/nsip.git
cd nsip

# Build
cargo build

# Run tests
cargo test

# Run linting
cargo clippy --all-targets --all-features

# Format code
cargo fmt

# Check supply chain security
cargo deny check

# Generate documentation
cargo doc --open

项目结构

crates/
├── lib.rs           # Library entry point
├── main.rs          # Binary entry point
├── client.rs        # HTTP client for the NSIP Search API
├── models.rs        # Data models (SearchCriteria, AnimalDetails, etc.)
├── format.rs        # Human-readable ASCII table formatting
└── mcp/             # MCP server (13 tools, prompts, resources)

tests/
├── integration_test.rs
└── cli_test.rs      # CLI integration tests

Cargo.toml           # Project manifest
clippy.toml          # Clippy configuration
rustfmt.toml         # Formatter configuration
deny.toml            # cargo-deny configuration
CLAUDE.md            # AI assistant instructions
AGENTS.md            # AI coding agent instructions
.editorconfig        # Cross-editor defaults
.devcontainer/       # Codespaces / dev container config
.vscode/             # VS Code settings and extensions

代码质量

该项目保持高代码质量标准:

  • 代码检查:夹着迂腐和幼稚的绒毛
  • 格式化:具有自定义配置的rustfmt
  • 测试:单元测试、集成测试和基于属性的测试
  • 文档:所有公共API都有示例记录
  • 供应链:货物拒绝依赖性审计
  • CI/CD:GitHub自动化测试操作

运行检查

# Run all checks
cargo fmt -- --check && \
cargo clippy --all-targets --all-features -- -D warnings && \
cargo test && \
cargo doc --no-deps && \
cargo deny check

# Run with MIRI for undefined behavior detection
cargo +nightly miri test

CI/CD和部署

此模板包括生产就绪工作流:

持续集成

  • 持续集成 (.github/workflows/ci.yml)-格式、lint、测试、文档、供应链安全、MSRV检查、覆盖率
  • 安全审计 (.github/workflows/security-audit.yml)-每日货物审计扫描
  • CodeQL 分析 (.github/workflows/codeql-analysis.yml)-推送/PR和每周时间表的SAST扫描
  • 基准 (.github/workflows/benchmark.yml)-有标准的绩效跟踪
  • ADR验证 (.github/workflows/adr-validation.yml)-架构决策记录验证

发布和部署

  • 发布 (.github/workflows/release.yml)-使用多平台二进制文件自动发布GitHub

- 构建版本:Linux(x86_64ARM64)、macOS(x86_64、ARM64)、Windows(x86_64) - 自动生成变更日志 - 二进制工件上传到版本

  • 更新日志 (.github/workflows/changelog.yml)-自动生成CHANGELOG.md

- 使用git cliff进行常规提交 - 遵循保持变更日志格式 - 在版本标签上触发

  • 码头工人 (.github/workflows/docker.yml)-多平台容器构建

- 平台:linux/amd64、linux/arm64 - 分散基础映像以实现安全 - 发布到GitHub容器注册表(ghcr.io) - 标记为版本和“最新”

  • 发布 (.github/workflows/publish.yml)-自动化crates.io发布

- 完整的预发布验证 - 在版本标签上触发 - 需要 CARGO_REGISTRY_TOKEN 秘密

创建发布

  1. 更新版本 Cargo.toml
  2. 创建并推送版本标签:
   git tag -a v0.4.0 -m "Release v0.4.0"
   git push origin v0.4.0
  1. 自动工作流:

- 生成变更日志 - 为所有平台构建二进制文件 - 使用工件创建GitHub版本 - 构建和推送Docker镜像 - 发布到crates.io

AI 编程助手

  • 副驾驶设置 (.github/workflows/copilot-setup-steps.yml)GitHub Copilot编码代理的环境
  • 代理说明: AGENTS.md, .github/copilot-instructions.md, CLAUDE.md
  • 特定路径说明: .github/instructions/ 用于Rust代码和测试模式
  • 可重复使用的提示: .github/prompts/ 用于常见的开发任务

Docker使用

拉动并运行容器:

# Pull latest
docker pull ghcr.io/zircote/nsip:latest

# Run specific version
docker pull ghcr.io/zircote/nsip:v0.4.0
docker run --rm ghcr.io/zircote/nsip:v0.4.0 --version

MSRV政策

最低支持的Rust版本(MSRV)为 1.92增加MSRV被认为是一个微小的突破性变化。

贡献

贡献.md 用于开发设置、PR检查表和编码标准。

请同时查看:

许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

致谢

目录标签

目录标签

RustClaude开发工具遗传评估本地部署动物育种CLI工具MCP服务器绵羊

支持客户端

ClaudeVS Code

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

13

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP