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

emotions-mcp-server

v1.0.16

Published

MCP Server for accessing PostgreSQL emotions database

Downloads

45

Readme

Emotions MCP Server

Ein Model Context Protocol (MCP) Server zur Verwaltung von Emotionen in einer PostgreSQL Datenbank.

Installation

npm install emotions-mcp-server

Konfiguration

Der Server benötigt eine Verbindung zu einer PostgreSQL Datenbank. Die Verbindungsdaten können über Umgebungsvariablen oder direkt beim Erstellen des Servers konfiguriert werden.

Umgebungsvariablen

  • DATABASE_URL: PostgreSQL Verbindungs-URL (z.B. postgresql://postgres:password@localhost:5432/emotions)

Continuous Integration

Das Projekt verwendet GitHub Actions für kontinuierliche Integration. Bei jedem Push zum main Branch wird automatisch:

  • Der Code gebaut und getestet
  • Linting durchgeführt
  • Ein GitHub Release erstellt (bei Tag-Erstellung)

Die Workflow-Datei befindet sich unter .github/workflows/build-and-deploy.yml.

Verwendung

Server starten

import { EmotionsMcpServer } from 'emotions-mcp-server';

// Mit Standardverbindung oder Umgebungsvariablen
const server = new EmotionsMcpServer();

// Oder mit benutzerdefinierten Verbindungsdaten
const server = new EmotionsMcpServer('postgresql://benutzer:passwort@localhost:5432/meine_db', 4000);

// Server starten
await server.start();

Client-Verwendung

import { EmotionsMcpClient } from 'emotions-mcp-server';

// Client mit UserContext erstellen
const client = new EmotionsMcpClient('benutzer-123');

// Tabelle prüfen und erstellen
const exists = await client.tableExists();
if (!exists) {
  await client.createTable();
}

// Neue Emotion einfügen
const emotion = {
  emotion: 'Freude',
  quellenart: 'Eigene Emotion',
  datum: new Date(),
  alter: 30
};

const newEmotion = await client.insertEmotion(emotion);
console.log(`Neue Emotion erstellt: ID ${newEmotion.id}, Nummer ${newEmotion.nummer}`);

// Emotion aktualisieren
const updatedEmotion = await client.updateEmotion(newEmotion.id, {
  emotion: 'Große Freude',
  auswirkungen: 'Gesteigertes Wohlbefinden'
});
console.log(`Emotion aktualisiert: ${updatedEmotion.emotion}`);

// Emotionen abfragen
const emotions = await client.getEmotions();
console.log(`${emotions.length} Emotionen gefunden`);

// Mit Filter abfragen
const filteredEmotions = await client.getEmotions({
  quellenart: 'Eigene Emotion',
  datumVon: new Date('2023-01-01')
});

// Neueste Emotionen abfragen (Standard: 10)
const recentEmotions = await client.getRecentEmotions();
console.log(`Die ${recentEmotions.length} neuesten Emotionen wurden abgerufen`);

// Neueste Emotionen mit Limit abfragen
const last5Emotions = await client.getRecentEmotions(5);
console.log(`Die 5 neuesten Emotionen wurden abgerufen`);

// Emotion löschen
await client.deleteEmotion(newEmotion.id);

Datenmodell

Emotion

Eingabefelder

| Feld | Typ | Beschreibung | |-------------|----------|------------------------------------------------------------------------| | emotion | string | Name der Emotion (Erforderlich) | | datum | Date | Datum an dem die Emotion gelöst wurde (Erforderlich) | | alter | number | Alter in dem die Emotion im Körper eingeschlossen wurde (Optional) | | quellenart | string | Art der Quelle: "Eigene Emotion", "Übernommene Emotion", "Geerbte Emotion" (Erforderlich) | | quelle | string | Quelle der Emotion (Leer bei eigenen Emotionen, aber erforderlich bei übernommenen/geerbten Emotionen) | | koerperteil | string | "Herzmauer" oder Name des Organs in dem die Emotion eingeschlossen war (Optional) | | auswirkungen| string | Körperliche oder emotionale Auswirkungen (Optional) | | bemerkungen | string | Zusätzliche Informationen (Optional) |

Gespeicherte Felder (EmotionRecord)

| Feld | Typ | Beschreibung | |-------------|----------|------------------------------------------------------------------------| | id | number | Eindeutige ID (automatisch generiert) | | userContext | string | Benutzerkontext (Tenant) | | nummer | number | Fortlaufende Nummer beginnend bei 1 (pro userContext, automatisch generiert) | | emotion | string | Name der Emotion | | datum | Date | Datum an dem die Emotion gelöst wurde | | alter | number | Alter in dem die Emotion im Körper eingeschlossen wurde | | quellenart | string | Art der Quelle: "Eigene Emotion", "Übernommene Emotion", "Geerbte Emotion" | | quelle | string | Quelle der Emotion, wenn nicht eigene | | koerperteil | string | "Herzmauer" oder Name des Organs in dem die Emotion eingeschlossen war | | auswirkungen| string | Körperliche oder emotionale Auswirkungen | | bemerkungen | string | Zusätzliche Informationen |

API-Methoden

| Methode | Parameter | Beschreibung | |-----------------|---------------------------------|-----------------------------------------| | tableExists | userContext: string | Prüft ob die Tabelle existiert | | createTable | - | Erstellt die Tabelle | | insertEmotion | userContext: string, emotion: Emotion | Fügt eine neue Emotion hinzu | | updateEmotion | userContext: string, emotionNumber: number, emotion: Emotion | Aktualisiert eine bestehende Emotion | | deleteEmotion | userContext: string, emotionNumber: number | Löscht eine Emotion | | getEmotions | userContext: string, filter?: EmotionFilter | Findet Emotionen mit Filter | | getEmotionByNumber | userContext: string, emotionNumber: number | Findet eine Emotion nach Nummer | | getRecentEmotions | userContext: string, limit?: number | Holt die neuesten Emotionen (Standard: 10) |

Lizenz

ISC