Copyright (c) 2026 Ascent Partners Foundation. MIT License.
This guide explains how to integrate the Humanity4AI MCP server into specific agent platforms. For LLM-native discovery, start with /llms.txt at the repository root.
The server uses the official @modelcontextprotocol/sdk JSON-RPC 2.0 protocol over stdio. All examples below use this standard protocol.
All adapters must:
- Start the server process:
pnpm --filter @humanity4ai/mcp-servers start - Send JSON-RPC 2.0 messages over stdin (one per line)
- Parse JSON-RPC 2.0 responses from stdout
- Surface
boundaryNoticeandescalation_guidanceto users when present - Disclose
uncertaintylevel where relevant to users
Add to your ~/.config/opencode/opencode.json:
{
"mcp": {
"humanity4ai": {
"type": "local",
"command": ["pnpm", "--dir", "/path/to/project_human", "--filter", "@humanity4ai/mcp-servers", "start"],
"enabled": true
}
}
}Or using npx (once published to npm):
{
"mcp": {
"humanity4ai": {
"type": "local",
"command": ["npx", "-y", "@humanity4ai/mcp-servers"],
"enabled": true
}
}
}Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"humanity4ai": {
"command": "pnpm",
"args": ["--filter", "@humanity4ai/mcp-servers", "start"],
"cwd": "/path/to/project_human"
}
}
}Add to .cursor/mcp.json in your project root:
{
"mcpServers": {
"humanity4ai": {
"command": "pnpm",
"args": ["--filter", "@humanity4ai/mcp-servers", "start"],
"cwd": "/path/to/project_human"
}
}
}Register each Humanity4AI action as a Copilot Plugin skill using the MCP SDK server:
# copilot-plugin.yaml excerpt
skills:
- id: supportive_reply
description: Generate empathetic, safety-bounded supportive conversation responses
parameters:
- name: message
type: string
required: true
- name: risk_level
type: string
enum: [low, medium, high]
required: true
handler:
type: mcp
command: pnpm
args: ["--filter", "@humanity4ai/mcp-servers", "start"]
tool_name: supportive_replyUse Manus AI's MCP integration to connect the server:
{
"mcpServers": {
"humanity4ai": {
"command": "pnpm",
"args": ["--filter", "@humanity4ai/mcp-servers", "start"],
"cwd": "/path/to/project_human"
}
}
}Or call programmatically via the MCP SDK client:
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
const transport = new StdioClientTransport({
command: "pnpm",
args: ["--filter", "@humanity4ai/mcp-servers", "start"],
cwd: "/path/to/project_human"
});
const client = new Client({ name: "manus-ai", version: "1.0" }, { capabilities: {} });
await client.connect(transport);
const result = await client.callTool({
name: "empathetic_reframe",
arguments: { message: "We cannot process your request.", tone: "warm" }
});
console.log(result.content);
await client.close();Use the MCP Client node (or Execute Command node) to call the server:
- Add an Execute Command node
- Set command:
pnpm --filter @humanity4ai/mcp-servers start - Send JSON-RPC 2.0 messages via stdin and parse stdout responses
- Route on the
result.contentfield
Install dependencies:
npm install langchain @langchain/openai @modelcontextprotocol/sdkimport { DynamicTool } from "@langchain/core/tools";
import { ChatOpenAI } from "@langchain/openai";
import { AgentExecutor, createOpenAIFunctionsAgent } from "langchain/agents";
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
// ── Humanity4AI MCP client ────────────────────────────────────────────────────
async function createMcpClient(): Promise<Client> {
const transport = new StdioClientTransport({
command: "pnpm",
args: ["--filter", "@humanity4ai/mcp-servers", "start"],
cwd: "/path/to/project_human"
});
const client = new Client({ name: "langchain-adapter", version: "1.0" }, { capabilities: {} });
await client.connect(transport);
return client;
}
// ── Create a LangChain tool from any Humanity4AI MCP tool ─────────────────────
function createHumanity4AITool(
client: Client,
toolName: string,
description: string
): DynamicTool {
return new DynamicTool({
name: toolName,
description,
func: async (inputJson: string) => {
let args: Record<string, unknown>;
try {
args = JSON.parse(inputJson) as Record<string, unknown>;
} catch {
return JSON.stringify({ error: "Input must be a valid JSON object string" });
}
const result = await client.callTool({ name: toolName, arguments: args });
// Surface boundary notice for audit purposes
const text = result.content
.filter((c: { type: string }) => c.type === "text")
.map((c: { text: string }) => c.text)
.join("\n");
return text;
}
});
}
// ── Example: empathetic_reframe in a LangChain agent ─────────────────────────
async function main() {
const client = await createMcpClient();
const tools = [
createHumanity4AITool(
client,
"empathetic_reframe",
"Reframes a message with empathy. Input JSON: {message: string, tone: 'warm'|'formal'|'neutral'}"
),
createHumanity4AITool(
client,
"supportive_reply",
"Generates a supportive, non-clinical reply. Input JSON: {message: string, risk_level: 'low'|'medium'|'high'}"
)
];
const llm = new ChatOpenAI({ model: "gpt-4o", temperature: 0 });
const agent = await createOpenAIFunctionsAgent({ llm, tools, prompt: null! });
const executor = new AgentExecutor({ agent, tools, verbose: true });
const result = await executor.invoke({
input: "A customer sent us: 'We cannot accept your excuse. This is unacceptable.' Please reframe it with empathy."
});
console.log(result.output);
await client.close();
}
main().catch(console.error);import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
export async function createHumanity4AIClient(projectRoot: string): Promise<Client> {
const transport = new StdioClientTransport({
command: "pnpm",
args: ["--filter", "@humanity4ai/mcp-servers", "start"],
cwd: projectRoot
});
const client = new Client({ name: "my-agent", version: "1.0" }, { capabilities: {} });
await client.connect(transport);
return client;
}
// List all available tools
const client = await createHumanity4AIClient("/path/to/project_human");
const { tools } = await client.listTools();
console.log(tools.map(t => t.name));
// Invoke a tool
const result = await client.callTool({
name: "empathetic_reframe",
arguments: { message: "Your request was denied.", tone: "warm" }
});
console.log(result.content);
await client.close();Perplexity's chat interface does not fetch arbitrary URLs like llms.txt or SYSTEM_PROMPT.md. The correct way to use Humanity4AI with Perplexity is to install the MCP server as a local connector via the Perplexity Mac app.
Step 1 — Publish to npm
This is a one-time step for the repository maintainer:
# From the mcp-servers directory
cd mcp-servers
npm publish --access publicStep 2 — Install as a Local MCP Connector (for Perplexity users)
- Open the Perplexity Mac app
- Go to Settings > Connectors
- Click Add Connector
- In the Simple tab, enter:
- Server Name:
humanity4ai - Command:
npx -y @humanity4ai/mcp-servers
- Server Name:
- Click Save
- Wait for the status to show Running
Step 3 — Use the skills in Perplexity
Once the connector is running, you can invoke any of the 10 skills by name. For example:
"Use the
supportive_replytool to respond to this message: 'I am feeling overwhelmed'"
Perplexity will then use the local MCP server to get the response from the Humanity4AI skillset.
Perplexity's chat interface is designed for web search and answering questions. It does not have the capability to fetch and read arbitrary file URLs from GitHub or other sources directly in its context. The only way to provide external tools and context is via the MCP connector mechanism.