Cover image
Try Now
2025-04-14

3 years

Works with Finder

0

Github Watches

0

Github Forks

0

Github Stars

mcp-file-url-analyzer MCP server

Servidor MCP que analiza archivos locales o URLs proporcionadas

Components

Resources

The server implements a simple note storage system with:

  • Custom note:// URI scheme for accessing individual notes
  • Each note resource has a name, description and text/plain mimetype

Prompts

The server provides a single prompt:

  • summarize-notes: Creates summaries of all stored notes
    • Optional "style" argument to control detail level (brief/detailed)
    • Generates prompt combining all current notes with style preference

Tools

The server implements one tool:

  • add-note: Adds a new note to the server
    • Takes "name" and "content" as required string arguments
    • Updates server state and notifies clients of resource changes

Configuration

[TODO: Add configuration details specific to your implementation]

Quickstart

Install

Claude Desktop

On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

Development/Unpublished Servers Configuration ``` "mcpServers": { "mcp-file-url-analyzer": { "command": "uv", "args": [ "--directory", "/home/javi/prueba", "run", "mcp-file-url-analyzer" ] } } ```
Published Servers Configuration ``` "mcpServers": { "mcp-file-url-analyzer": { "command": "uvx", "args": [ "mcp-file-url-analyzer" ] } } ```

Development

Building and Publishing

To prepare the package for distribution:

  1. Sync dependencies and update lockfile:
uv sync
  1. Build package distributions:
uv build

This will create source and wheel distributions in the dist/ directory.

  1. Publish to PyPI:
uv publish

Note: You'll need to set PyPI credentials via environment variables or command flags:

  • Token: --token or UV_PUBLISH_TOKEN
  • Or username/password: --username/UV_PUBLISH_USERNAME and --password/UV_PUBLISH_PASSWORD

Debugging

Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.

You can launch the MCP Inspector via npm with this command:

npx @modelcontextprotocol/inspector uv --directory /home/javi/prueba run mcp-file-url-analyzer

Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.

Análisis de archivos y URLs

Este servidor MCP permite analizar archivos individuales, directorios completos y URLs (tanto texto como binario). Usa los comandos MCP:

  • analyze_path(path: str): Analiza un archivo o directorio local. Si es directorio, recorre todos los archivos.
  • analyze_url(url: str): Descarga y analiza el contenido de la URL (texto o binario).

El análisis de texto muestra número de líneas, palabras, tamaño y un preview. El análisis binario muestra tamaño, tipo y preview en hexadecimal.

Requisitos

Este proyecto requiere Python 3.12 o superior. Instala las dependencias con:

pip install -r requirements.txt

Estructura del proyecto

  • src/mcp_file_url_analyzer/server.py: Código principal del servidor MCP.
  • requirements.txt: Dependencias del entorno.
  • pyproject.toml: Configuración de empaquetado y metadatos.
  • .env: Variables de entorno sensibles (no subir a repositorios públicos).

Ejecución local

  1. Activa el entorno virtual:
    source .venv/bin/activate
    
  2. Instala las dependencias:
    pip install -r requirements.txt
    
  3. Ejecuta el servidor MCP:
    python -m src.mcp_file_url_analyzer.server
    

Dependencias principales

  • mcp>=1.6.0
  • aiofiles
  • httpx
  • pydantic

Notas de seguridad

  • El archivo .env contiene credenciales sensibles. Asegúrate de que esté en .gitignore.

Ejemplos de uso

Analizar un archivo local

from mcp.client import MCPClient
client = MCPClient()
result = await client.tool('analyze-path', path='/ruta/al/archivo.txt')
print(result)

Analizar un directorio local

result = await client.tool('analyze-path', path='/ruta/al/directorio')
print(result)

Analizar una URL (texto o binario)

result = await client.tool('analyze-url', url='https://ejemplo.com/archivo.txt')
print(result)
  • El resultado será un diccionario con información relevante según el tipo de archivo o contenido.

Referencias

相关推荐

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

  • Byaidu
  • PDF科学纸翻译带有保留格式的pdf -基于ai完整保留排版的pdf文档全文双语翻译

  • rulego
  • ⛓️Rulego是一种轻巧,高性能,嵌入式,下一代组件编排规则引擎框架。

  • sigoden
  • 使用普通的bash/javascript/python函数轻松创建LLM工具和代理。

  • hkr04
  • 轻巧的C ++ MCP(模型上下文协议)SDK

  • RockChinQ
  • 😎简单易用、🧩丰富生态 -大模型原生即时通信机器人平台| 适配QQ / 微信(企业微信、个人微信) /飞书 /钉钉 / discord / telegram / slack等平台| 支持chatgpt,deepseek,dify,claude,基于LLM的即时消息机器人平台,支持Discord,Telegram,微信,Lark,Dingtalk,QQ,Slack

  • dmayboroda
  • 带有可配置容器的本地对话抹布

  • paulwing
  • 使用MCP服务创建的测试存储库

    Reviews

    3.8 (4)
    Avatar
    user_z2tMWx5L
    2025-04-23

    I've been using the mcp_file_url_analyzer by jriescoldev and it's been fantastic. The interface is very user-friendly and it does an excellent job analyzing file URLs swiftly and accurately. It's evident a lot of thought went into its development, making it an invaluable tool for anyone needing detailed URL analysis. Highly recommended!

    Avatar
    user_Dmozyg7L
    2025-04-23

    As an avid user of the mcp_file_url_analyzer by jriescoldev, I must say this tool is outstanding for analyzing file URLs effortlessly. The seamless integration and user-friendly interface make it an essential tool for my daily tasks. Highly recommend it for anyone needing an efficient URL analysis solution!

    Avatar
    user_iBshj1y8
    2025-04-23

    The mcp_file_url_analyzer by jriescoldev is a superb tool for efficiently analyzing and managing file URLs. This utility impressed me with its intuitive interface and powerful capabilities. It streamlined my workflow and improved productivity significantly. Highly recommend it to professionals who deal with lots of files and URLs.

    Avatar
    user_0uEVbPfo
    2025-04-23

    The mcp_file_url_analyzer by jriescoldev is a fantastic tool! It efficiently analyzes file URLs with ease, making my workflow significantly smoother. The user-friendly interface and reliable performance have made it an indispensable part of my daily operations. Highly recommended for anyone needing a robust URL analysis solution!