
seanivore/mcp-file-preview
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
HTML 파일 미리보기 및 분석을위한 MCP 서버 - OS와 이상한했지만 Cline에서 좋은 WIP
개요
HTML 파일 미리보기 및 분석 기능을 제공하는 Model Context Protocol (MCP) 서버. 이 서버는 로컬 HTML 파일의 전체 페이지 스크린 샷을 캡처하고 구조를 분석 할 수 있습니다. - : 적절한 CSS 스타일링이있는 HTML 파일의 전체 페이지 스크린 샷 캡처 - : Analyze HTML 구조 (헤딩, 단락, 이미지, 링크) - : 로컬 파일 경로 및 리소스를 처리 - : 전용 디렉토리에 스크린 샷을 저장 Claude 또는 Cline MCP 설정에 서버를 추가하십시오. ~/Library/Application Support/Claude/claude desktop config.json에 추가하십시오: 스크린 샷을 캡처하고 HTML 콘텐츠를 반환 : 스크린 샷은 프로젝트 폴더의 스크린 샷 / 디렉토리에 저장됩니다. 반환의 수: - 제목 - 그림 - 이미지 - 링크 서버는 적절한 초기화로 MCP SDK의 Server 클래스를 사용합니다
개요(AI 번역)
HTML 파일 미리보기 및 분석 기능을 제공하는 Model Context Protocol (MCP) 서버. 이 서버는 로컬 HTML 파일의 전체 페이지 스크린 샷을 캡처하고 구조를 분석 할 수 있습니다.
특징
- ** 파일 미리보기 **: 적절한 CSS 스타일링과 HTML 파일의 전체 페이지 스크린 샷 캡처 -Content Analysis: 분석 HTML 구조(헤딩, 단락, 이미지, 링크)
- Local 파일 지원: 로컬 파일 경로 및 리소스 처리
- Screenshot 관리: 스크린 샷을 전용 디렉토리에 저장
설치
-
저장소를 복제:
-
의존성 설치:
-
프로젝트 구축:
구성
Claude 또는 Cline MCP 설정에 서버를 추가하십시오.
Claude 데스크탑 앱
~/Library/Application Support/Claude/claude_desktop_config.json에 추가:
Cline VSCode 확장
VSCode의 MCP 설정에 추가:
사용법
서버는 두 가지 주요 도구를 제공합니다:
미리보기 파일
스크린 샷을 캡처하고 HTML 콘텐츠를 반환 :
스크린 샷은 프로젝트 폴더에 screenshots/ 디렉토리에 저장됩니다.
분석 content
HTML 구조 분석:
반환의 수:
- 헤드링
- 특허
- 이미지
- 링크
개발
-
의존성 설치:
-
명세.
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
MCP File Preview Server
A Model Context Protocol (MCP) server that provides HTML file preview and analysis capabilities. This server enables capturing full-page screenshots of local HTML files and analyzing their structure.
Features
- File Preview: Capture full-page screenshots of HTML files with proper CSS styling
- Content Analysis: Analyze HTML structure (headings, paragraphs, images, links)
- Local File Support: Handle local file paths and resources
- Screenshot Management: Save screenshots to a dedicated directory
Installation
- Clone the repository:
git clone https://github.com/your-username/mcp-file-preview.git
cd mcp-file-preview
- Install dependencies:
npm install
- Build the project:
npm run build
Configuration
Add the server to your Claude or Cline MCP settings:
Claude Desktop App
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"file-preview": {
"command": "node",
"args": ["/path/to/mcp-file-preview/build/index.js"]
}
}
}
Cline VSCode Extension
Add to VSCode’s MCP settings:
{
"mcpServers": {
"file-preview": {
"command": "node",
"args": ["/path/to/mcp-file-preview/build/index.js"]
}
}
}
Usage
The server provides two main tools:
preview_file
Captures a screenshot and returns HTML content:
file-preview
preview_file
{
"filePath": "/path/to/file.html",
"width": 1024, // optional
"height": 768 // optional
}
Screenshots are saved to screenshots/ directory in the project folder.
analyze_content
Analyzes HTML structure:
file-preview
analyze_content
{
"filePath": "/path/to/file.html"
}
Returns counts of:
- Headings
- Paragraphs
- Images
- Links
Development
- Install dependencies:
npm install @modelcontextprotocol/sdk puppeteer typescript @types/node @types/puppeteer
- Make changes in
src/ - Build:
npm run build
- Test locally:
npm run dev
Implementation Details
The server uses the MCP SDK’s Server class with proper initialization:
this.server = new Server(
// Metadata object
{
name: 'file-preview-server',
version: '0.1.0'
},
// Options object with capabilities
{
capabilities: {
tools: {
preview_file: {
description: 'Preview local HTML file and capture screenshot',
inputSchema: {
// ... schema definition
}
}
}
}
}
);
Key points:
- Server constructor takes separate metadata and options objects
- Tools are declared in capabilities.tools
- Each tool needs a description and inputSchema
설치
npx @modelcontextprotocol/inspector설정
{
"mcpServers": {
"file-preview": {
"command": "node",
"args": ["/path/to/mcp-file-preview/build/index.js"]
}
}
}