
3mdistal/css-mcp-server
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
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)
Быстрый старт
Выполните следующие действия, чтобы сервер работал быстро:
- **Клон Репозитория: **
2.Установить зависимости:
-
**Приготовьте API-ключ: ** Инструмент
get_latest_updatesтребует ключ API OpenRouter. Получите ключ от OpenRouter. Вы предоставите этот ключ своему клиенту в шаге 5. -
**Постройте сервер: ** Составьте код 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 likeyarnorpnpm)- 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:
-
Clone the Repository:
git clone https://github.com/3mdistal/css-mcp-server.git cd css-mcp-server -
Install Dependencies:
npm install # Or: yarn install / pnpm install -
Prepare API Key: The
get_latest_updatestool requires an OpenRouter API key. Obtain your key from OpenRouter. You will provide this key to your MCP client in Step 5. -
Build the Server: Compile the TypeScript code.
npm run build # Or: yarn build / pnpm run build -
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
argsis the correct absolute path to the builtindex.jsfile on your system. Replace the placeholder API key.) -
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.
-
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.
- Go to
-
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.
Установка
npx @modelcontextprotocol/inspector node ./build/index.jsКонфигурация
{
"mcpServers": {
"css-tutor": {
"command": "node",
"args": [
"/full/path/to/your/css-mcp-server/build/index.js"
],
"env": {
"OPENROUTER_API_KEY": "sk-or-xxxxxxxxxxxxxxxxxxxxxxxxxx"
}
}
}
}