Skip to main content
Glama

MCP Spotify

by yhwancha

MCP 服务器 TypeScript 入门

这是一个使用 TypeScript 创建模型上下文协议 (MCP) 服务器的入门模板。它提供了基本设置和示例工具实现,帮助您开始构建自己的 MCP 服务器。

特征

  • TypeScript 配置
  • 基本 MCP 服务器设置
  • 示例工具实现
  • 类型安全的开发环境

入门

请按照以下步骤创建您自己的 MCP 服务器:

# Create a new directory for your project mkdir <project_name> cd <project_name> # Initialize a new npm project npm init -y # Install dependencies npm install @modelcontextprotocol/sdk zod npm install -D @types/node typescript # Create source directory and main file mkdir src touch src/index.ts

项目结构

. ├── src/ │ └── index.ts # Main server implementation ├── package.json # Project dependencies and scripts └── tsconfig.json # TypeScript configuration

发展

  1. src/index.ts中实现你的工具
  2. 构建项目:
    npm run build

添加新工具

要添加新工具,请使用server.tool()方法。例如:

server.tool( "tool-name", "tool-description", { // Define your tool's parameters using Zod schema param: z.string().describe("parameter description") }, async ({ param }) => { // Implement your tool logic here return { content: [ { type: "text", text: `Tool executed with parameter: ${param}`, }, ], }; }, );

MCP 服务器配置

您可以在项目中配置多个 MCP 服务器。以下是示例配置:

{ "mcpServers": { "<server_name>": { "command": "<command>", "args": [ "--directory", "/ABSOLUTE/PATH/TO/PARENT/FOLDER/<project_name>", "run", "<script_name>" ] } } }

此配置指定:

  • <server_name> :您的 MCP 服务器的唯一标识符
  • command :运行脚本的命令(例如, pythonnodeuv
  • args :命令行参数数组
    • --directory :设置脚本的工作目录
    • 特定于您的命令和脚本需求的其他参数

您可以通过向mcpServers对象添加更多条目来配置多个服务器。

执照

ISC# venmo-mcp

mcp-spotify

-
security - not tested
-
license - not tested
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

一个可能实现与 Spotify 的 API 交互的 MCP 服务器模板,允许用户通过自然语言命令执行与 Spotify 相关的操作。

  1. 特征
    1. 入门
      1. 项目结构
        1. 发展
          1. 添加新工具
            1. MCP 服务器配置
              1. 执照
                1. mcp-spotify

                  Related MCP Servers

                  • A
                    security
                    A
                    license
                    A
                    quality
                    Enables interaction with Spotify's music catalog via the Spotify Web API, supporting searches, artist information retrieval, playlist management, and automatic token handling.
                    Last updated -
                    26
                    547
                    2
                    TypeScript
                    MIT License
                  • A
                    security
                    F
                    license
                    A
                    quality
                    A FastMCP tool that enables control of Spotify through natural language commands in Cursor Composer, allowing users to manage playback, search for content, and interact with playlists.
                    Last updated -
                    21
                    1
                    Python
                  • A
                    security
                    F
                    license
                    A
                    quality
                    A lightweight Model Context Protocol server that enables AI assistants like Cursor & Claude to control Spotify playback and manage playlists.
                    Last updated -
                    12
                    80
                    TypeScript
                  • -
                    security
                    -
                    license
                    -
                    quality
                    A Model Context Protocol server that enables controlling Spotify playback through natural language commands in MCP clients like Cursor or Claude for Desktop.
                    Last updated -
                    1
                    TypeScript

                  View all related MCP servers

                  MCP directory API

                  We provide all the information about MCP servers via our MCP API.

                  curl -X GET 'https://glama.ai/api/mcp/v1/servers/yhwancha/mcp-spotify'

                  If you have feedback or need assistance with the MCP directory API, please join our Discord server