mcp

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mcp 实现 kite mcp:本地 stdio MCP 服务,把只读的网易云接口暴露给 Claude / Cursor 等 AI 客户端。

与 CLI 一样直连 engine + endpoint 声明(engine.ExecuteWithCookie),不经 gRPC / service; 登录态用本机的 kite login(NETEASE_COOKIE 环境变量优先),每次调用时读取,重新登录后无需重启。

只读是硬约束:不暴露红心、收藏、歌单编辑等写操作,AI 不能替用户修改账号(server_test.go 守护)。 stdout 是协议通道,本包不得向 stdout 打印任何东西。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand(k *kit.Kit) *cobra.Command

NewCommand 构造 kite mcp:以 stdio MCP 服务运行,供 AI 客户端调用只读的网易云接口。

func NewServer

func NewServer(d Deps, version string) *mcp.Server

NewServer 构造注册了全部只读工具的 MCP 服务。version 用于向客户端报告实现版本。

func RPCs

func RPCs() []string

RPCs 返回全部工具消费的 rpc,供 kite mcp 命令打命令树守护注解。

func Run

func Run(ctx context.Context, d Deps, version string) error

Run 以 stdio 传输运行 MCP 服务,直到客户端断开或 ctx 取消。

Types

type Deps

type Deps struct {
	Engine *engine.Engine
	Cookie func() string
}

Deps 是 MCP 服务的依赖:执行 endpoint 的 engine,以及每次调用时取当前 cookie 的函数(未登录返回空串)。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL