fetch-log-mcp-server

fetch-log-mcp-server

An MCP server that fetches remote logs from specified IP addresses via HTTP, with configurable port and log path.

Category
Visit Server

README

Fetch Log MCP Server

一个用于获取远端日志的 MCP (Model Context Protocol) 服务器。

功能特性

  • 支持从指定 IP 地址获取日志内容
  • 可配置端口号和日志路径
  • 使用 TypeScript 开发,类型安全
  • 简单易用的 API 接口

安装和运行

方法一:全局安装(推荐)

# 全局安装
npm install -g .

# 查看帮助
fetch-log-mcp-server --help

# 查看版本
fetch-log-mcp-server --version

# 启动服务器
fetch-log-mcp-server

方法二:本地开发

# 1. 安装依赖
npm install

# 2. 构建项目
npm run build

# 3. 运行服务器
npm start

# 4. 开发模式
npm run dev

使用方法

命令行选项

  • --help, -h: 显示帮助信息
  • --version, -v: 显示版本信息

MCP 工具参数

  • ip (必需): 目标服务器的 IP 地址
  • port (可选): 目标服务器的端口号,默认为 28668
  • path (可选): 日志路径,默认为 /logs

示例

1. 启动 MCP 服务器

fetch-log-mcp-server

2. 通过 MCP 客户端调用工具

{
  "name": "fetch_logs",
  "arguments": {
    "ip": "192.168.1.100",
    "port": 28668,
    "path": "/logs"
  }
}

这将执行 curl -XGET "http://192.168.1.100:28668/logs" 来获取日志内容。

3. 配置文件示例 (mcp.json)

{
  "mcpServers": {
    "fetch-log-server": {
      "command": "fetch-log-mcp-server"
    }
  }
}

项目结构

fetch-log-mcp-server/
├── src/
│   └── index.ts          # 主服务器文件
├── dist/                 # 编译输出目录
├── package.json          # 项目配置
├── tsconfig.json         # TypeScript 配置
└── README.md            # 项目说明

技术栈

  • TypeScript
  • @modelcontextprotocol/sdk
  • axios (用于 HTTP 请求)

错误处理

服务器包含完善的错误处理机制:

  • 网络请求超时(30秒)
  • 连接错误处理
  • 参数验证

许可证

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured