3C

3mdistal/css-mcp-server

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

32 stars 16 forks Качество 58 Тренд 0

3mdistal/css-mcp-сервер - это кандидат на сервер MCP, импортированный из https://github.com/3mdistal/css-mcp-server.

Обзор

3mdistal/css-mcp-сервер - это кандидат на сервер MCP, импортированный из https://github.com/3mdistal/css-mcp-server.

Обзор (машинный перевод)

Этот репо содержит простой сервер Model Context Protocol (MCP), построенный с помощью Node.js и TypeScript. Он действует как «наставник CSS», предоставляя персонализированные обновления функций CSS подключенному клиенту ИИ.

Этот сервер демонстрирует ключевые концепции MCP: определение Ресурсы, Инструменты и Программы. Цель этой демонстрации состоит в том, чтобы помочь вам двигаться дальше и создавать гораздо более крупные и интересные агентные возможности.

Предпосылки

Node.js (v18 или более поздняя рекомендация) npm (или ваш предпочтительный менеджер пакетов Node.js, такой как yarn или pnpm)) Клиент ИИ, способный подключаться к серверу MCP (например, настольное приложение Claude) OpenRouter API Key (для получения живых обновлений CSS через Perplexity)

Быстрый старт

Выполните следующие действия, чтобы сервер работал быстро:

  1. **Клон Репозитория: **

2.Установить зависимости:

  1. **Приготовьте API-ключ: ** Инструмент get_latest_updates требует ключ API OpenRouter. Получите ключ от OpenRouter. Вы предоставите этот ключ своему клиенту в шаге 5.

  2. **Постройте сервер: ** Составьте код TypeScript.

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

Building a CSS Tutor MCP Server

This repo contains a simple Model Context Protocol (MCP) server built with Node.js and TypeScript. It acts as a “CSS Tutor,” providing personalized updates about CSS features to a connected AI client.

This server demonstrates key MCP concepts: defining Resources, Tools, and Prompts. The goal of this demonstration is to help you move on from here and build much larger and more interesting agentic capabilities.

Prerequisites

  • Node.js (v18 or later recommended)
  • npm (or your preferred Node.js package manager like yarn or pnpm)
  • An AI client capable of connecting to an MCP server (e.g., the Claude desktop app)
  • An OpenRouter API Key (for fetching live CSS updates via Perplexity)

Quick Start

Follow these steps to get the server running quickly:

  1. Clone the Repository:

    git clone https://github.com/3mdistal/css-mcp-server.git
    cd css-mcp-server
    
  2. Install Dependencies:

    npm install # Or: yarn install / pnpm install
    
  3. Prepare API Key: The get_latest_updates tool requires an OpenRouter API key. Obtain your key from OpenRouter. You will provide this key to your MCP client in Step 5.

  4. Build the Server: Compile the TypeScript code.

    npm run build # Or: yarn build / pnpm run build
    
  5. Configure Your MCP Client: Tell your client how to launch the server and provide the API key as an environment variable. Here’s an example for the Claude desktop app’s claude_desktop_config.json:

    {
      "mcpServers": {
        "css-tutor": {
          "command": "node",
          "args": [
            "/full/path/to/your/css-mcp-server/build/index.js"
          ],
          "env": {
            "OPENROUTER_API_KEY": "sk-or-xxxxxxxxxxxxxxxxxxxxxxxxxx"
          }
        }
      }
    }
    

    (Ensure the path in args is the correct absolute path to the built index.js file on your system. Replace the placeholder API key.)

  6. Connect: Start the connection from your MCP client. The client will launch the server process (with the API key in its environment), and you can start interacting!

Using with Cursor

Cursor is an AI-first code editor that can act as an MCP client. Setting up this server with Cursor is straightforward, but requires an extra step for the guidance prompt.

  1. Configure Server in Cursor:

    • Go to Cursor Settings > MCP > Add new global MCP server.
    • Paste in the same JSON as above in the Claude Desktop step, with all the same caveats.
  2. Create a Cursor Project Rule for the Prompt: Cursor currently does not automatically use MCP prompts provided by servers. Instead, you need to provide the guidance using Cursor’s Project Rules feature.

Открыть полный README на GitHub

Установка

npx @modelcontextprotocol/inspector node ./build/index.js
Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "css-tutor": { "command": "node", "args": [ "/full/path/to/your/css-mcp-server/build/index.js" ], "env": { "OPENROUTER_API_KEY": "sk-or-xxxxxxxxxxxxxxxxxxxxxxxxxx" } } } }