# Model Context Protocol (MCP) Server

> Embedded Model Context Protocol server for connecting Claude Code, Claude Desktop, and Cursor directly to PeopleSoft intelligence.

---

LLMS index: [llms.txt](/llms.txt)

---

## Embedded MCP Server

psLens includes a high-performance **embedded Model Context Protocol (MCP) Server** running directly inside the Go server process over Streamable HTTP and HTTP+SSE. It enables LLMs and coding assistants (such as **Claude Desktop**, **Claude Code CLI**, and **Cursor**) to inspect, analyze, triage, and compare PeopleSoft environments in real time with zero local daemon installation.

---

## Authentication & Personal Access Tokens

Access to the psLens MCP endpoints (`/mcp` and `/mcp/sse`) is secured via cryptographically generated Personal Access Tokens:

1. Navigate to **Settings → MCP Tokens** (`/settings/mcp`) in psLens.
2. Click **Generate New Token**.
3. Choose a memorable label (e.g. `Claude Desktop (MacBook)`) and expiration period (30 days, 90 days, 1 year, or never).
4. Copy the raw secret key (`psl_mcp_...`). The secret is hashed with SHA-256 and stored in the internal NATS KV store; it is only displayed once upon generation.

---

## Connecting Your AI Assistants

### 1. Claude Desktop

Add psLens to your Claude Desktop configuration file:

- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`

```json
{
  "mcpServers": {
    "pslens": {
      "url": "http://localhost:8080/mcp",
      "headers": {
        "Authorization": "Bearer psl_mcp_YOUR_TOKEN_HERE"
      }
    }
  }
}
```

### 2. Claude Code CLI

Add psLens with a single command in your terminal:

```bash
claude mcp add --transport sse pslens http://localhost:8080/mcp/sse --header "Authorization: Bearer psl_mcp_YOUR_TOKEN_HERE"
```

---

## Agent Ergonomics & Design Highlights

The psLens MCP server is engineered specifically for autonomous AI coding agents:

- **Safe Tool Annotations**: All inspection, audit, and triage tools include MCP annotations (`readOnlyHint: true`, `destructiveHint: false`, `idempotentHint: true`, `openWorldHint: false`), eliminating intrusive permission popups in Claude Desktop and Cursor.
- **Self-Describing Numeric Enums**: Payloads automatically include human-readable enum decoders (`FieldTypeDesc`, `FormatDesc`, `RecTypeDesc`, `RunStatusDesc`) alongside PeopleTools integer constants.
- **Subrecord Expansion**: `get_object_definition` supports `expand_subrecords: true` to recursively flatten nested subrecords into a single effective field list.
- **Reverse Field Where-Used Graph**: `get_object_dependencies(object_type='field')` scans containing records (`PSRECFIELD`), displaying pages (`PSPAGEFIELD`), and referencing PSQueries (`PSQRYFIELD`).
- **Credential Protection**: `get_table_sample_and_count` automatically strips sensitive password, salt, and token columns from table row samples.

---

## Available Tools Catalog

The psLens MCP server offers specialized PeopleSoft tooling:

### 🔍 Metadata & PeopleCode Exploration

- `search_objects`: Fast wildcard search across supported PeopleSoft object types (records, fields, pages, components, menus, app engines, app packages, queries, projects, CIs, service operations, users, roles, and permission lists).
- `get_object_definition`: Fetch structured metadata, field lists, subrecords (with optional flattening via `expand_subrecords`), keys, and related definitions.
- `get_peoplecode`: Retrieve formatted source code for Record Events, App Packages, Component PostBuild/SaveEdit, Page Events, and App Engine Action steps.
- `get_object_dependencies`: Discover forward and reverse dependencies (record prompt tables/components/pages/queries, field records/pages/queries, or component pages/records/permissions/roles).
- `search_code_sql`: Search across PeopleCode, SQL objects, and App Engine SQL with configurable scope (`all`, `peoplecode`, `sql`, `appengine`) and `case_sensitive` filtering.
- `get_table_sample_and_count`: Inspect row counts and data samples for configuration and transactional tables safely (sensitive password/token columns automatically excluded).
- `export_object_markdown`: Export any PeopleSoft object (32+ object types) as a comprehensive, structured Markdown document with properties, related tables, and optional recursive PeopleCode reference inlining (`recursive_pc: true`).

### 🛡️ Security Graph & Access Auditing

- `user_access_summary`: Complete security profile for any OPRID (roles, permission lists, lock status, Campus Solutions security).
- `who_has_access`: Backward traversal to identify every user, role, and permission list with access to a component, menu, or service operation.
- `audit_dangerous_access`: Automated scanning for elevated privileges, full-access permission lists, and SOAP-to-CI vulnerabilities.
- `query_tree_access`: Inspect Query Access Group Trees, authorized permission lists, and record query authorization.
- `user_login_audit`: Review failed logins and authentication event history from `PSPTLOGINAUDIT`.

### ⚡ Operations & Sensor Health Monitoring

- `get_system_health`: Real-time health sensor telemetry for a PeopleSoft environment (Process Scheduler heartbeats from `PSSERVERSTAT`, Integration Broker domain status from `PSAPMSGDOMSTAT`, down message nodes from `PSNODESDOWN`, stalled/overdue process requests, locked-OPRID jobs, recent errors, active firing alerts, and overall `HEALTHY`/`DEGRADED`/`CRITICAL` classification).
- `get_process_request_details`: Deep runtime inspection for any Process Scheduler instance: run control parameters, job hierarchy, execution duration, and run status.
- `get_ib_transaction_details`: Deep inspection of an Integration Broker asynchronous publication/subscription contract by PubID or synchronous transaction by GUID.
- `triage_process_scheduler`: Inspect stuck, error, queued, or running process instances with human-readable run statuses (`RunStatusDesc`).
- `triage_integration_broker`: Identify failed, retry, or timeout asynchronous and synchronous transaction contracts.
- `list_active_alerts`: Retrieve live firing alert incidents, active severity levels, and background alert checker configurations.

### 🔄 Comparison & Automated Reports

- `compare_project`: Compare object definitions, field structures, and PeopleCode across two environments (e.g. `HCMDEV` vs `HCMPROD`).
- `compare_object`: Point-to-point comparison of an individual PeopleSoft object (record, PeopleCode program, SQL object, role, permission list, app engine, component, page, file layout, message, service operation) across two databases without needing a project definition.
- `compare_recurring_processes`: Detect differences in recurrence schedules and parameters between environments.
- `find_missing_projects`: Discover projects present in one database but missing in another.
- `list_available_reports`: Catalog of all built-in psLens security, IB, and batch audit reports with metadata and parameters.
- `run_report`: Execute any report on demand and return structured markdown findings.

---

## Passive Resources

Agents can passively subscribe to or read structured context feeds:

- `pslens://databases`: List of configured PeopleSoft databases, connection health, and production status.
- `pslens://catalog/object-types`: Catalog of supported PeopleSoft metadata families and search conventions.
- `pslens://env/summary`: Real-time summary of connected environments and active alert counts.
- `pslens://alerts/active`: Live list of all currently firing alert incidents across all monitored environments.
- `pslens://system/health/{db}`: Real-time health sensor telemetry, Process Scheduler status, and IB health for the specified database.
- `pslens://whitelist/{db}`: Whitelisted tables allowed for SWS introspection in a given database.

---

## Workflow Prompts

The MCP server exposes guided multi-step prompts for incident response, development, and proactive monitoring:

- **`proactive_system_monitor`**: Autonomous monitoring agent sequence inspecting system health telemetry, Process Scheduler status, Integration Broker status, and active alerts.
- **`post_migration_verification`**: Runs object difference verification, recurrence consistency checks, and IB routing health tests after a project migration.
- **`incident_triage`**: Automated diagnostic sequence for on-call administrators during production alerts or performance spikes.
- **`user_security_audit`**: Deep-dive security and segregation of duties (SoD) audit for a specific user ID.
- **`impact_analysis`**: Calculates the upstream/downstream blast radius and dependencies before modifying a record, field, or component.

---

## PeopleTools 8.63 Native MCP vs. psLens MCP

PeopleTools 8.63 introduces native Model Context Protocol (MCP) server support directly into the PeopleSoft platform, positioning it as an "Integration Broker for AI." While both implementations use the open MCP standard, they serve different layers and operational needs:

|            Capability            |                                                    PeopleTools 8.63 Native MCP                                                    |                                                                                                                                                                                                                                         psLens Embedded MCP Server                                                                                                                                                                                                                                         |
| :------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Target Audience**              | End users, functional analysts, developers in App Designer                                                                        | Administrators, DBAs, Developers, Security Auditors, SREs                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **PeopleTools Version**          | Requires **PeopleTools 8.63+** exclusively                                                                                        | **Version Agnostic**: PeopleTools 8.53 through 8.63+                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **Environment Scope**            | **Single-database bounded**: Queries only the hosted 8.63 instance                                                                | **Multi-environment orchestration**: Simultaneously queries and compares `DEV`, `TEST`, and `PROD` in one session                                                                                                                                                                                                                                                                                                                                                                                          |
| **Core Focus**                   | • Natural Language Search (OpenSearch)<br>• Transactional Application Services<br>• App Designer AI Assist (code generation/docs) | • Deep Metadata Introspection (records, subrecord flattening, page buffers, components, App Engines, SQL Objects)<br>• Reverse Where-Used Dependency Graph<br>• PeopleCode extraction across all container types<br>• Security Graph & Access Auditing (SoD, reverse component access, dangerous permissions, query trees, login audit)<br>• Operational Triage (Process Scheduler queues, locked OPRIDs, IB error/sync exceptions, live alerts)<br>• Cross-Environment Migration & Project Drift Auditing |
| **Cross-Environment Drift**      | Not supported natively across environments                                                                                        | Built-in: `compare_project`, `find_missing_projects`, `compare_recurring_processes`                                                                                                                                                                                                                                                                                                                                                                                                                        |
| **Infrastructure Prerequisites** | Full PT 8.63 stack (WebLogic PIA, Tuxedo App Server, OpenSearch)                                                                  | Standalone Go service connecting via Simple Web Services (SWS) with database whitelisting (`CHG_PSLENS_WL`)                                                                                                                                                                                                                                                                                                                                                                                                |
| **Agent Optimizations**          | Standard PeopleSoft JSON payloads                                                                                                 | Human-readable enum decoders (`FieldTypeDesc`, `RunStatusDesc`), password column exclusion, safe read-only tool annotations                                                                                                                                                                                                                                                                                                                                                                                |

### How They Coexist

- **Use PeopleTools 8.63 Native MCP** for conversational end-user AI (e.g. self-service transactions, employee requests, OpenSearch natural language document queries) on a PeopleTools 8.63 environment.
- **Use psLens MCP** when developers, administrators, auditors, and AI coding agents (Claude Code, Claude Desktop, Cursor) need deep system introspection, security auditing, cross-environment drift comparison, and operational incident triage across any PeopleTools environment today.
