Murphys Laws

com.murphys-laws由 murphys-laws.com 發布v1.2.5更新於 Oct 24, 2026

Access thousands of Murphy's Laws: search, browse by category, random, daily, submit.

概覽

AI 產生的概覽

透過此本地 MCP 伺服器,存取關於生活傾向出錯的幽默觀察集合。

可以做什麼
可透過搜尋、瀏覽類別或獲取隨機定律來檢索墨菲定律。它允許使用者查看每日定律或提交新的定律供考慮。
適用情境
當您希望 AI 助理存取經過策劃的、幽默的墨菲定律集合以用於知識問答或創意情境時,請使用此伺服器。
執行需求
作為本地程序透過 npm 套件安裝運行。未宣告任何外部 API 金鑰或環境變數。
安裝前請注意
此伺服器提供公開的幽默內容,不處理敏感使用者資料或執行修改外部系統的操作。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Murphys Laws,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Murphy's Laws

[Web CI] [Dependency Audit]

[PRs Welcome] [Maintenance] [License: CC0-1.0] [Node.js] [iOS] [Android]

A comprehensive collection of Murphy's Laws - humorous observations about life's tendency for things to go wrong.

Available on the Web, with iOS and Android releases forthcoming.

Platforms

AI & Developer Integration

Four official ways to integrate Murphy's Laws. No API key for reads.

PackagenpmPurpose
murphys-laws-sdk[npm]Typed TypeScript client, zero deps
murphys-laws-cli[npm]Command-line interface (npx murphys-laws-cli)
murphys-laws-mcp[npm]Model Context Protocol server for AI agents
REST API-Public HTTP API at https://murphys-laws.com/api/v1/

Full details and examples on the developer landing page.

REST API

Public API at https://murphys-laws.com/api/v1/, no auth required for reads.

TypeScript SDK

murphys-laws-sdk on npm is a tiny typed client over the REST API with zero runtime dependencies.

ts
import { MurphysLawsClient } from 'murphys-laws-sdk';const law = await new MurphysLawsClient().getRandomLaw();

Command-line interface

murphys-laws-cli on npm wraps the API for scripts and terminal use.

bash
npx murphys-laws-cli randomnpx murphys-laws-cli search "computer" --limit 3

MCP Server (Model Context Protocol)

An MCP server lets AI agents (Claude Desktop, Cursor, VS Code Copilot) query Murphy's Laws directly.

Quick start, no clone needed:

json
{  "mcpServers": {    "murphys-laws": {      "command": "npx",      "args": ["-y", "murphys-laws-mcp"]    }  }}

7 tools: search_laws, get_random_law, get_law_of_the_day, get_law, list_categories, get_laws_by_category, submit_law.

See mcp/README.md or npm, or the developer landing page for the full picture.

Repository Structure

This is a monorepo containing:

murphys-laws/├── backend/        # Node.js API server (TypeScript runtime via tsx)├── web/            # Web application (TypeScript + Vite)├── mcp/            # MCP server for AI agent integration (npm: murphys-laws-mcp)├── sdk/            # TypeScript SDK over the public REST API (npm: murphys-laws-sdk)├── cli/            # Command-line interface (npm: murphys-laws-cli)├── ios/            # iOS app (Swift + SwiftUI)├── android/        # Android app (Kotlin + Jetpack Compose)└── shared/         # Shared resources and documentation

Quick Start

Backend (API Server)

bash
cd backendnpm installnpm run build:db # Build SQLite databasenpm run dev # Start API servernpm start # Run API from src/server/api-server.ts via tsx

Web Application

bash
cd webnpm installnpm run dev # Start dev server

iOS App

bash
cd iosopen MurphysLaws.xcodeproj# Press ⌘R to run

Android App

bash
cd android./gradlew assembleDebug# Or open in Android Studio

Documentation

Testing

bash
# Run all tests (backend, web, SDK, CLI, and MCP)npm test
# Test a subset onlynpm run test:backend   # Backend Vitest suitenpm run test:web       # Web Vitest suite only (no E2E)npm run test:web:e2e   # Web E2E (Playwright) only

Development

Prerequisites

  • Node.js 22+
  • For iOS: macOS, Xcode 15+
  • For Android: Android Studio Hedgehog+, JDK 17+

Install Dependencies

bash
# Install all dependencies (root and workspaces)npm run install:all
# Or install individuallycd backend && npm installcd web && npm install

Run Development Servers

bash
# Run backend + web concurrentlynpm run dev
# Or run individuallynpm run dev:backendnpm run dev:web

Note: The predev script automatically cleans up any orphaned processes using ports 8787 and 5175 before starting.

Troubleshooting Port Issues

If you encounter EADDRINUSE errors (port already in use):

bash
# Check which processes are using development portsnpm run cleanup-ports
# Automatically kill processes using development portsnpm run cleanup-ports -- --kill
# Or manually check and killlsof -i :8787  # Check API portlsof -i :5175  # Check frontend portkill <PID>     # Kill the process

Building

bash
# Generate OpenAPI and build the web appnpm run build
# Build specific platformnpm run build:webnpm run build:backend:db

TypeScript Runtime Architecture

  • Backend runs TypeScript source directly with tsx (no JS build step required for startup).
  • Canonical backend runtime entrypoint: backend/src/server/api-server.ts.
  • PM2 runtime uses Node loader: node --import tsx.
  • Shared runtime templates are TypeScript in shared/modules/*.ts.

Deployment

See Deployment Guide for detailed instructions.

bash
# Deploy web app (builds and syncs to production)npm run deploy

Keyboard Shortcuts (Web)

Press ? anywhere on the site to see all available shortcuts:

ShortcutAction
/Focus search
↑ / ↓Navigate search suggestions (when autocomplete is open)
EnterSelect search suggestion (when autocomplete is open)
EscapeClose search suggestions / modal / popover
jNext law card
kPrevious law card
?Show shortcuts help
Enter / SpaceActivate focused card

Search Autocomplete: When typing in the search field, suggestions appear automatically. Use arrow keys to navigate, Enter to select, or Escape to close.

Contributing

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

Policies and Support

  • Security: Private vulnerability reporting and supported versions.
  • Privacy: Data-handling policy.
  • Support: Help and troubleshooting.
  • Agent Guide: Canonical instructions for AI coding agents.
  • Design System: Token and component-contract guidance.

License

This project is licensed under CC0 1.0 Universal (Public Domain).

Acknowledgments

Thanks to all contributors who have submitted Murphy's Laws over the years!


Made with love for anyone who's ever experienced Murphy's Law in action

來源:README.md,提交 f771fd8

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:軟體包安裝失敗。

版本歷史

2
  1. v1.2.5最新Oct 24, 2026
  2. v1.2.1Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。