@atom8n/mcp-notify
v0.5.3
Published
A MCP server for system notifications (Windows/macOS)
Downloads
12
Readme
@atom8n/mcp-logger
A Model Context Protocol (MCP) server that fetches logs from a local server running on localhost:6277. This package provides a simple interface to retrieve paginated log entries through the MCP protocol.
Overview
The mcp-logger is an MCP server implementation that acts as a bridge between MCP clients and a local logging service. It provides a single tool called get_logs that fetches log entries from http://localhost:6277/logs/current with support for pagination.
Features
- Log Retrieval: Fetch logs from a local server endpoint
- Pagination Support: Retrieve logs in pages with configurable limits
- Error Handling: Comprehensive error handling with descriptive messages
- MCP Protocol: Full compliance with Model Context Protocol standards
- TypeScript Support: Built with TypeScript for type safety
Installation
Global Installation
npm install -g @atom8n/mcp-loggerLocal Installation
npm install @atom8n/mcp-loggerMCP Configuration
To use this MCP server with an MCP client, add the following configuration to your MCP client settings:
{
"mcpServers": {
"mcp-logger": {
"command": "npx",
"args": [
"@atom8n/mcp-logger"
]
}
}
}Alternative Configuration (if installed globally)
{
"mcpServers": {
"mcp-logger": {
"command": "mcp-logger"
}
}
}Usage
Once configured, the MCP server provides the following tool:
get_logs
Fetches logs from the local server at http://localhost:6277/logs/current.
Parameters:
page(optional, number): Page number for pagination (default: 1)limit(optional, number): Number of log entries per page (default: 50)
Example Usage:
// Fetch first page with default limit (50 entries)
await mcpClient.callTool("get_logs", {});
// Fetch second page with 25 entries per page
await mcpClient.callTool("get_logs", {
page: 2,
limit: 25
});Prerequisites
- Local Server: A server must be running on
localhost:6277that provides logs at the/logs/currentendpoint - Node.js: Version 14 or higher
- MCP Client: A compatible MCP client to interact with the server
Error Handling
The server provides detailed error messages for common scenarios:
- Connection Refused: When the local server is not running
- HTTP Errors: When the server responds with error status codes
- Timeout Errors: When requests take longer than 10 seconds
- Network Issues: When no response is received
Development
Project Structure
mcp-installer/
├── src/
│ └── index.mts # Main TypeScript source
├── lib/
│ ├── index.mjs # Compiled JavaScript
│ ├── index.mjs.map # Source map
│ └── index.d.mts # TypeScript declarations
├── package.json # Package configuration
├── tsconfig.json # TypeScript configuration
└── eslint.config.mjs # ESLint configurationBuilding from Source
- Clone the repository:
git clone <repository-url>
cd mcp-installer- Install dependencies:
npm install- Build the project:
npm run prepareDependencies
Runtime Dependencies:
@modelcontextprotocol/sdk: MCP SDK for server implementationaxios: HTTP client for making requestsrimraf: Cross-platform file deletion utilityspawn-rx: Observable-based process spawning
Development Dependencies:
@types/node: TypeScript definitions for Node.jsshx: Cross-platform shell commandsts-node: TypeScript execution for Node.jstypescript: TypeScript compiler
API Reference
Server Configuration
The MCP server is configured with:
- Name:
mcp-logger - Version:
0.5.3 - Transport: StdioServerTransport
- Capabilities: Tools support
Tool Schema
{
name: "get_logs",
description: "Fetch logs from the local server at http://localhost:6277/logs/current",
inputSchema: {
type: "object",
properties: {
page: {
type: "number",
description: "Page number for pagination (default: 1)",
default: 1
},
limit: {
type: "number",
description: "Number of log entries per page (default: 50)",
default: 50
}
},
required: []
}
}License
MIT License - see COPYING file for details.
Contributing
Please read our Code of Conduct before contributing.
Version History
- 0.5.3: Current version with MCP SDK v1.0.1 support
- 0.5.2: Previous version (as referenced in source code)
Support
For issues and questions:
- Check if the local server is running on
localhost:6277 - Verify the
/logs/currentendpoint is accessible - Review error messages for specific connection issues
Changelog
v0.5.3
- Updated to MCP SDK v1.0.1
- Improved error handling
- Enhanced TypeScript support
- Updated dependencies
