JP's MCP Collection

JP's MCP Collection

A comprehensive utility MCP server that enables AI assistants to execute system commands, manage files, integrate with Google Sheets and Tasks, perform AI-powered text processing, and load dynamic prompts from markdown files.

Category
访问服务器

README

JP's MCP Collection

JP's personal collection of Model Context Protocol (MCP) modules that provides a set of utility functions for Claude and other AI assistants. Built using the MCP SDK, this server exposes tools for system operations, Google services integration, and AI-powered text processing.

Overview

MCPs are built using the MCP SDK and exposes a set of tools that can be used by AI assistants to interact with:

  • System command execution
  • File system operations
  • Google Sheets integration
  • Google Tasks management
  • OpenAI chat completion and grammar checking
  • Dynamic prompt loading from markdown files

Features

System Operations

  • Command Execution: Run shell commands on the system with proper error handling and safety checks

File System Operations

  • Move Files to Trash: Safely delete files by moving them to the system trash
  • Read Images: Read image files and return base64-encoded content with metadata

Google Sheets Integration

  • List Sheets: Get available sheets in the configured spreadsheet
  • Read Sheet Content: Read data from specific ranges with pagination support
  • Update Sheets: Modify cell values in spreadsheets
  • Delete Rows: Remove specific rows from sheets
  • Get Sheet Properties: Retrieve metadata about sheet structure
  • Conditional Formatting: Add row-based conditional formatting rules

Google Tasks Management

  • Task Lists: Create, update, delete, and list task lists
  • Tasks: Full CRUD operations for tasks including creation, updates, completion, and deletion
  • Subtasks: Create hierarchical task structures
  • Task Properties: Manage due dates, notes, and task status

AI-Powered Text Processing

  • Chat Completion: Send prompts to OpenAI's GPT models with customizable parameters
  • Grammar Checking: Improve text grammar and clarity using AI

Dynamic Prompt Management

  • Automatic Prompt Loading: Loads prompts from markdown files at server startup
  • Flexible Configuration: Configure prompt directory via environment variables
  • Smart Naming: Auto-generate prompt names from filenames when not specified in frontmatter
  • Frontmatter Support: Parse markdown frontmatter for prompt metadata

Usage

The server runs using Deno and can be started in development mode:

# Run in development mode
npm run dev

# Run with the MCP inspector for debugging
npm run monitor

# Format code
npm run format

Project Organization

Directory Structure

jp-mcps/
├── package.json        # Project configuration and dependencies
├── README.md           # Documentation
├── .env.example        # Environment variables template
├── prompts/            # Default directory for dynamic prompts
└── src/                # Source code
    ├── modules/        # Modular MCP tool implementations
    │   ├── command/    # System command execution
    │   │   ├── functions/
    │   │   │   ├── run-command.ts
    │   │   │   └── index.ts
    │   │   ├── registerCommand.ts
    │   │   └── index.ts
    │   ├── dynamic-prompts/ # Dynamic prompt loading
    │   │   ├── functions/
    │   │   │   ├── load-prompts.ts
    │   │   │   └── index.ts
    │   │   ├── utils/
    │   │   │   ├── to-snake-case.ts
    │   │   │   └── index.ts
    │   │   ├── registerDynamicPrompts.ts
    │   │   └── index.ts
    │   ├── filesystem/ # File system operations
    │   │   ├── functions/
    │   │   │   ├── move-file-to-trash.ts
    │   │   │   ├── read-image.ts
    │   │   │   └── index.ts
    │   │   ├── registerFilesystem.ts
    │   │   └── index.ts
    │   ├── hello/      # Reference implementation module
    │   ├── openai/     # OpenAI API integration
    │   │   ├── functions/
    │   │   │   ├── chat-completion.ts
    │   │   │   ├── check-grammar.ts
    │   │   │   └── index.ts
    │   │   ├── registerOpenAI.ts
    │   │   └── index.ts
    │   ├── sheets/     # Google Sheets API integration
    │   │   ├── functions/
    │   │   │   ├── list-sheets.ts
    │   │   │   ├── list-sheet-content.ts
    │   │   │   ├── update-sheet.ts
    │   │   │   ├── delete-row.ts
    │   │   │   ├── get-sheet-properties.ts
    │   │   │   ├── add-row-conditional-formatting.ts
    │   │   │   └── index.ts
    │   │   ├── registerGoogleSheets.ts
    │   │   ├── utils.ts
    │   │   └── index.ts
    │   └── tasks/      # Google Tasks API integration
    │       ├── functions/
    │       │   ├── list-task-lists.ts
    │       │   ├── create-task-list.ts
    │       │   ├── update-task-list.ts
    │       │   ├── delete-task-list.ts
    │       │   ├── list-tasks.ts
    │       │   ├── create-task.ts
    │       │   ├── update-task.ts
    │       │   ├── complete-task.ts
    │       │   ├── delete-task.ts
    │       │   ├── create-subtask.ts
    │       │   └── index.ts
    │       ├── registerGoogleTasks.ts
    │       ├── client.ts
    │       └── index.ts
    └── index.ts        # Main entry point

Code Organization

The JP MCPs project follows a modular architecture designed for maintainability and extensibility:

  1. Main Entry Point: src/index.ts initializes the MCP server and registers all available tools.

  2. Modular Functions: Each capability is encapsulated in its own module within the modules directory with standardized patterns:

    • Each module has a functions/ directory containing individual function implementations
    • Functions are named in kebab-case for consistency
    • Each function file includes its Zod input schema alongside the implementation
    • Modules export their functions and corresponding schema definitions for type safety
    • Each function follows a consistent error handling pattern
  3. MCP Tool Registration: Tools are registered in module-specific register files using the server.tool() method which takes:

    • A tool name (used by Claude to invoke the function)
    • A schema definition (using Zod for runtime type validation)
    • An async handler function implementing the tool's logic
  4. Response Formatting: Each function formats its responses consistently as an object with content property containing text output.

  5. Error Handling: Comprehensive error handling with a TypeScript-safe approach using a utility function getErrorMessage() that properly handles both Error objects and unknown error types.

Design Patterns

JP MCPs employs several key design patterns:

  • Facade Pattern: Each module presents a simplified interface to complex subsystems (APIs, filesystem, etc.)
  • Function-based Organization: Clean separation of concerns with focused functions for each operation
  • Schema Validation: All inputs are validated using Zod schemas before processing
  • Consistent Error Handling: Try/catch blocks with standardized error responses
  • Type Safety: Heavy use of TypeScript and zod.infer for type definitions

Dependencies

  • @modelcontextprotocol/sdk: Core MCP SDK for building MCP servers
  • @googleapis/sheets: Google Sheets API client
  • @googleapis/tasks: Google Tasks API client
  • google-auth-library: Authentication for Google services
  • gray-matter: Markdown frontmatter parsing for dynamic prompts
  • openai: OpenAI API client for chat completion and text processing
  • execa: Process execution for running system commands
  • trash: Safe file deletion by moving to system trash
  • zod: Schema validation and type safety

Environment Variables

The following environment variables need to be configured:

  • OPENAI_API_KEY: Your OpenAI API key for chat completion and grammar checking
  • GOOGLE_CLIENT_ID: Google OAuth client ID for Tasks API
  • GOOGLE_CLIENT_SECRET: Google OAuth client secret for Tasks API
  • GOOGLE_REDIRECT_URI: Google OAuth redirect URI for Tasks API
  • GOOGLE_REFRESH_TOKEN: Google OAuth refresh token for Tasks API
  • PROMPTS_DIRECTORY: Directory path containing markdown prompt files (defaults to "./prompts")

Dynamic Prompts Setup

Create markdown files in your prompts directory with frontmatter:

---
name: my_prompt
description: Description of what this prompt does
---

Your prompt content here...

Naming Rules:

  • If name is provided in frontmatter, it will be used as-is
  • If name is missing, the filename (without .md) will be converted to snake_case
  • If description is missing, it defaults to an empty string

Example:

  • File: Code Review.md → Prompt name: code_review
  • File: generate-tests.md → Prompt name: generate_tests

Integration

JP MCPs is designed to be used as a tool provider for AI assistants like Claude through the Model Context Protocol, which allows the assistant to invoke functions defined in this server.

Security Notes

  • Command execution includes safety checks for potentially dangerous operations
  • File operations are limited to safe actions (move to trash, read images)
  • All API calls are properly authenticated and use official client libraries
  • Input validation is performed using Zod schemas before any operations
  • Dynamic prompts are loaded from configurable directories to avoid hardcoded paths

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选