Build and publish / Test and build (darwin) (push) Failing after 1m42s
Build and publish / Test and build (linux) (push) Failing after 1m53s
Build and publish / Test and build (windows) (push) Failing after 2m50s
Build and publish / Build and publish Docker image (push) Skipped
Go rewrite of the Python Emby.MCP server with tool parity (20 tools), plus a streamable-HTTP transport with per-request Emby authentication (Basic / Bearer token passthrough), a multi-arch Docker build, and a Gitea CI workflow.
27 lines
765 B
Go
27 lines
765 B
Go
package server
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/gordon/emby-mcp/internal/state"
|
|
"github.com/modelcontextprotocol/go-sdk/mcp"
|
|
)
|
|
|
|
func registerUserTools(s *mcp.Server, st *state.State) {
|
|
mcp.AddTool(s, &mcp.Tool{
|
|
Name: "retrieve_user_list",
|
|
Description: `Retrieves a list of user names and their user IDs from the Emby server in JSON format.
|
|
|
|
Returns:
|
|
Dict: as JSON with keys:
|
|
user_id (str): Unique user ID
|
|
user_name (str): user name`,
|
|
}, func(ctx context.Context, req *mcp.CallToolRequest, in struct{}) (*mcp.CallToolResult, any, error) {
|
|
users, err := st.Client.GetUsers(ctx, "", "")
|
|
if err != nil {
|
|
return textResult(errf("ERROR: failed to retrieve user list because: %v", err)), nil, nil
|
|
}
|
|
return jsonResult(users), nil, nil
|
|
})
|
|
}
|