npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dhealth_intelligence

v1.1.2-alpha

Published

A Model Context Protocol (MCP) server that provides intelligent tools for file operations, memory management, news retrieval, and email processing.

Readme

dHealth Intelligence

A Model Context Protocol (MCP) server that provides intelligent tools for file operations, memory management, news retrieval, and email processing.

Features

  • File Operations

    • Read file contents (supports text, image, and PDF files)
    • List directory contents
  • Memory Management

    • Add memories with topics and notes
    • Retrieve memories by topic
    • Persistent storage in JSON format
  • News Retrieval

    • Search news by country and category
    • Support for multiple news categories
    • Pagination support
  • Email Processing

    • IMAP email retrieval
    • Email parsing and processing
    • PDF to image conversion

Prerequisites

  • Node.js (v16 or higher)
  • npm or yarn
  • TypeScript
  • Bun (optional, for creating executables)

Installation

  1. Clone the repository:
git clone https://github.com/dhealthproject/dhealth-intelligence.git
cd dhealth-intelligence
  1. Install dependencies:
npm install
  1. Set up environment variables:
# Memory file path (optional, defaults to memory.json in project root)
MEM_PATH=/path/to/memory.json

# News API configuration
NEWSDATA_API_URL=https://api.example.com/news
NEWSDATA_API_KEY=your_api_key_here

# Email configuration
EMAIL_HOST=your_imap_host
EMAIL_USER=your_email
EMAIL_PASSWORD=your_password

Configuration

The application uses a centralized configuration system. You can modify the default values in src/config/index.ts:

export const config = {
  memory: {
    path: process.env.MEM_PATH ?? path.resolve('memory.json')
  },
  news: {
    baseUrl: process.env.NEWSDATA_API_URL ?? 'https://api.example.com/news',
    apiKey: process.env.NEWSDATA_API_KEY ?? '',
    defaultCountry: 'us',
    defaultCategory: 'top'
  },
  email: {
    imapUser: process.env.IMAP_USER ?? '',
    imapPass: process.env.IMAP_PASS ?? '',
    imapHost: process.env.IMAP_HOST ?? '',
    imapPort: Number(process.env.IMAP_PORT) ?? 993,

    smtpServ: process.env.SMTP_SERVICE ?? '',
    smtpUser: process.env.SMTP_USER ?? '',
    smtpPass: process.env.SMTP_PASS ?? '',
    smtpHost: process.env.SMTP_HOST ?? '',
    smtpPort: Number(process.env.SMTP_PORT) ?? 587,
  }
} as const;

Usage

File Operations

// Read a file
const result = await fileService.readFile({ uri: '/path/to/file.txt' });

// List directory contents
const contents = await fileService.readFolder({ uri: '/path/to/directory' });

Memory Management

// Add a memory
await memoryService.addMemory({
  topic: 'meeting',
  note: 'Discuss project timeline'
});

// Retrieve memories
const memories = await memoryService.getMemory({ topic: 'meeting' });

News Retrieval

// Get news by category
const news = await newsService.getNews({
  country: 'us',
  category: 'technology'
});

// Get news with pagination
const nextPage = await newsService.getNews({
  page: 'next_page_token'
});

Email Processing

// Read emails
const emails = await emailService.readEmails({
  folder: 'INBOX',
  noEmails: 5
});

// Send email
const result = await emailService.sendEmail({
  receiver: "[email protected]",
  subject: "email subject",
  textContent: "email content in text",
  htmlContent: "<p>email content in html</p>"
});

Error Handling

The application uses a centralized error handling system. All errors are handled consistently and return a standardized response format:

{
  content: [{
    type: 'text',
    text: 'Error message with context'
  }]
}

Development

  1. Build the project:
npm run build
  1. Run with inspector for debugging:
npm run inspector
  1. Create executable (requires Bun):
npm run create_executable

Project Structure

src/
├── config/         # Configuration files
├── services/       # Service implementations
├── strategies/     # Strategy patterns for file reading
├── types/         # TypeScript type definitions
└── utils/         # Utility functions

Dependencies

Main Dependencies

  • @modelcontextprotocol/sdk: ^1.11.3
  • imap: ^0.8.19
  • mailparser: ^3.7.3
  • nodemailer: ^7.0.3
  • pdftoimg-js: ^0.2.2
  • zod: ^3.24.4

Development Dependencies

  • @types/imap: ^0.8.42
  • @types/mailparser: ^3.4.6
  • @types/node: ^22.15.18
  • @types/nodemailer: ^6.4.17
  • typescript: ^5.8.3

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments