- S
+
SquareMCP
@@ -294,6 +294,8 @@
diff --git a/product/site/nginx-site.conf b/product/site/nginx-site.conf
index a8e532d..558d245 100644
--- a/product/site/nginx-site.conf
+++ b/product/site/nginx-site.conf
@@ -6,7 +6,7 @@ server {
index index.html;
location / {
- try_files $uri $uri/ /index.html;
+ try_files $uri $uri.html $uri/ /index.html;
}
location = /index.html {
diff --git a/product/site/privacy.html b/product/site/privacy.html
index 52f5dd3..9656c98 100644
--- a/product/site/privacy.html
+++ b/product/site/privacy.html
@@ -1,41 +1,136 @@
-
+
-
-
-
-
Privacy Policy — SquareMCP
-
-
-
-
-
Privacy Policy
-
SquareMCP — Last updated April 28, 2026
+
+
+
+
Privacy Policy — SquareMCP
+
+
+
+
+
-
What SquareMCP is
-
SquareMCP is a personal MCP server platform that connects AI assistants to your own tools — email, notes, and internal systems. It is operated by Garfield Heron and is currently in private pilot.
+
+
+ Legal
+ Privacy Policy
+ Last updated May 5, 2026
- Data we collect
- We collect only what is necessary to operate the service: your name, email address, company, and use case when you submit a pilot request. This information is stored securely and used only to evaluate and onboard pilot participants.
+
+ Scope
+
+ This Privacy Policy describes how SquareMCP collects, uses, and protects information
+ when you visit squaremcp.com, contact us, or participate in a SquareMCP pilot or
+ managed deployment.
+
+
- Data we do not collect
- SquareMCP does not use analytics, advertising trackers, or third-party data sharing of any kind. We do not sell or rent your information.
+
+ Information we collect
+ We may collect:
+
+ - contact details such as your name, work email, company, and role
+ - pilot intake details such as your use case, target systems, and security requirements
+ - service and operational data needed to provision, secure, and support a deployment
+ - communications you send to us by email or through the pilot intake form
+
+
- Your data and your tools
- When you use SquareMCP to connect your own accounts (email, notes, calendars), those connections are authenticated via OAuth and run entirely within your own environment. Your data does not pass through SquareMCP infrastructure — the MCP server runs on your own host or a host you control.
+
+ How we use information
+ We use information to:
+
+ - review and respond to pilot requests
+ - configure and operate SquareMCP deployments
+ - authenticate access, troubleshoot issues, and maintain security controls
+ - communicate about pilots, support, billing, and service changes
+
+
- OAuth tokens
- OAuth access tokens used to authenticate AI sessions are stored in a private database on your server. They expire after 24 hours and are never shared with third parties.
+
+ Customer data and connected systems
+
+ SquareMCP is designed to act as a managed MCP gateway for internal tools. Depending on
+ the deployment, customer data may remain in a customer-controlled environment or may be
+ processed in SquareMCP-managed infrastructure as part of the service. The exact data
+ path depends on the deployment architecture and connector configuration.
+
+
+ Pilot and production customers are responsible for evaluating which systems they choose
+ to connect and which tool permissions they enable for their users and agents.
+
+
- Contact
- Questions or requests: garfield@fetcherpay.com
-
+
+ Authentication credentials and tokens
+
+ SquareMCP may process API keys, OAuth credentials, session metadata, audit records, and
+ related access-control data needed to operate the service. We use these credentials only
+ to authenticate approved integrations and support the configured deployment.
+
+
+
+
+ Sharing
+
+ We do not sell personal information. We may share information with infrastructure,
+ hosting, email, or support providers only to the extent reasonably necessary to run the
+ service, support customers, comply with law, or protect SquareMCP and its users.
+
+
+
+
+ Retention
+
+ We retain information for as long as reasonably necessary to evaluate pilots, deliver
+ services, maintain records, and meet legal, operational, or security obligations.
+
+
+
+
+ Security
+
+ We use reasonable administrative, technical, and operational measures to protect
+ information. No system can guarantee absolute security, and you should not submit
+ information through the service unless you are comfortable with that risk profile.
+
+
+
+
+ Your choices
+
+ You may contact us to request access, correction, or deletion of personal information we
+ hold about you, subject to legal and operational limits.
+
+
+
+
+ Contact
+
+ Questions about this Privacy Policy can be sent to
+ .
+
+
+
+
+ This page is a general website and pilot-stage privacy policy. It should be reviewed and
+ adapted if SquareMCP moves into broader commercial availability or regulated deployments.
+
+
+
+
diff --git a/product/site/squaremcp-logo-linkedin-transparent.png b/product/site/squaremcp-logo-linkedin-transparent.png
new file mode 100644
index 0000000..5805d85
Binary files /dev/null and b/product/site/squaremcp-logo-linkedin-transparent.png differ
diff --git a/product/site/squaremcp-logo-linkedin.jpg b/product/site/squaremcp-logo-linkedin.jpg
new file mode 100644
index 0000000..7985da1
Binary files /dev/null and b/product/site/squaremcp-logo-linkedin.jpg differ
diff --git a/product/site/squaremcp-logo-linkedin.png b/product/site/squaremcp-logo-linkedin.png
new file mode 100644
index 0000000..bf7898e
Binary files /dev/null and b/product/site/squaremcp-logo-linkedin.png differ
diff --git a/product/site/squaremcp-logo.svg b/product/site/squaremcp-logo.svg
new file mode 100644
index 0000000..84c53f8
--- /dev/null
+++ b/product/site/squaremcp-logo.svg
@@ -0,0 +1,18 @@
+
diff --git a/product/site/styles.css b/product/site/styles.css
index 29c9c93..023772b 100644
--- a/product/site/styles.css
+++ b/product/site/styles.css
@@ -58,15 +58,11 @@ a {
font-weight: 800;
}
-.brand-mark {
- display: inline-flex;
- align-items: center;
- justify-content: center;
- width: 30px;
- height: 30px;
- border-radius: 8px;
- background: var(--accent);
- color: #fff;
+.brand-logo {
+ display: block;
+ width: 34px;
+ height: 34px;
+ flex: 0 0 auto;
}
.brand-text {
@@ -465,6 +461,72 @@ textarea:focus {
flex-wrap: wrap;
}
+.legal-shell {
+ min-height: 100vh;
+ background:
+ radial-gradient(circle at top right, #d9e6ff 0%, transparent 24%),
+ linear-gradient(180deg, #f8fbff 0%, #eef3fb 100%);
+}
+
+.legal-main {
+ padding: 40px 0 64px;
+}
+
+.legal-card {
+ width: min(860px, calc(100% - 32px));
+ margin: 0 auto;
+ padding: 28px;
+ background: var(--surface);
+ border: 1px solid var(--line);
+ border-radius: 12px;
+ box-shadow: 0 18px 40px rgba(22, 41, 76, 0.08);
+}
+
+.legal-eyebrow {
+ margin-bottom: 10px;
+ color: var(--accent-strong);
+ font-size: 13px;
+ font-weight: 700;
+ text-transform: uppercase;
+}
+
+.legal-title {
+ margin-bottom: 8px;
+}
+
+.legal-subhead {
+ margin: 0 0 28px;
+ color: var(--muted);
+ font-size: 15px;
+}
+
+.legal-section + .legal-section {
+ margin-top: 28px;
+}
+
+.legal-section h2 {
+ margin-bottom: 10px;
+ font-size: 24px;
+}
+
+.legal-section p,
+.legal-section li {
+ color: var(--muted);
+}
+
+.legal-section ul {
+ margin: 0;
+ padding-left: 20px;
+}
+
+.legal-note {
+ margin-top: 28px;
+ padding: 16px 18px;
+ border-radius: 10px;
+ background: var(--accent-soft);
+ color: var(--text);
+}
+
@media (max-width: 980px) {
h1 {
font-size: 42px;
@@ -517,4 +579,16 @@ textarea:focus {
.band {
padding: 44px 0;
}
+
+ .legal-main {
+ padding: 28px 0 48px;
+ }
+
+ .legal-card {
+ padding: 22px;
+ }
+
+ .legal-section h2 {
+ font-size: 22px;
+ }
}
diff --git a/product/site/terms.html b/product/site/terms.html
new file mode 100644
index 0000000..6ddfcd7
--- /dev/null
+++ b/product/site/terms.html
@@ -0,0 +1,140 @@
+
+
+
+
+
+
Terms of Service — SquareMCP
+
+
+
+
+
+
+
+
+ Legal
+ Terms of Service
+ Last updated May 5, 2026
+
+
+ Agreement
+
+ These Terms of Service govern your access to and use of SquareMCP, including the
+ squaremcp.com website, pilot engagements, managed deployments, and related support.
+ By using SquareMCP, you agree to these Terms.
+
+
+
+
+ Service description
+
+ SquareMCP provides managed MCP infrastructure and related services for connecting AI
+ agents to customer-approved internal tools, systems, and data sources.
+
+
+
+
+ Pilot and beta status
+
+ Some SquareMCP offerings are pilot, beta, or limited-availability services. Features
+ may change, and services may be modified, suspended, or discontinued at any time,
+ especially during pilot phases.
+
+
+
+
+ Customer responsibilities
+ You are responsible for:
+
+ - providing accurate information during pilot intake and onboarding
+ - ensuring you have authority to connect systems, accounts, and data sources
+ - configuring appropriate permissions, approvals, and internal safeguards
+ - reviewing agent behavior and tool outputs before relying on them in production workflows
+ - complying with applicable laws, regulations, and contractual obligations
+
+
+
+
+ Acceptable use
+ You may not use SquareMCP to:
+
+ - access systems or data without authorization
+ - bypass security controls or usage restrictions
+ - interfere with the service or other users
+ - process unlawful, infringing, or abusive content or workflows
+
+
+
+
+ Third-party systems
+
+ SquareMCP depends on third-party providers, APIs, models, cloud services, and customer
+ systems. We are not responsible for downtime, changes, pricing, restrictions, or data
+ handling practices of those third parties.
+
+
+
+
+ No warranty
+
+ SquareMCP is provided on an “as is” and “as available” basis. To the maximum extent
+ permitted by law, SquareMCP disclaims all warranties, express or implied, including
+ warranties of merchantability, fitness for a particular purpose, and non-infringement.
+
+
+
+
+ Limitation of liability
+
+ To the maximum extent permitted by law, SquareMCP will not be liable for indirect,
+ incidental, special, consequential, exemplary, or punitive damages, or for loss of
+ data, revenue, profits, or goodwill arising from or related to the service.
+
+
+
+
+ Suspension and termination
+
+ We may suspend or terminate access if necessary to protect the service, comply with law,
+ address security risks, or respond to a breach of these Terms.
+
+
+
+
+ Changes
+
+ We may update these Terms from time to time. Continued use of SquareMCP after updated
+ Terms are posted constitutes acceptance of the revised Terms.
+
+
+
+
+ Contact
+
+ Questions about these Terms can be sent to
+ .
+
+
+
+
+ These Terms are a practical baseline for the current SquareMCP pilot site. They should be
+ reviewed by counsel before broad commercial rollout or regulated-enterprise contracting.
+
+
+
+
+
diff --git a/src/clients/linkedin.ts b/src/clients/linkedin.ts
new file mode 100644
index 0000000..1d33e5c
--- /dev/null
+++ b/src/clients/linkedin.ts
@@ -0,0 +1,142 @@
+const LINKEDIN_API_BASE = 'https://api.linkedin.com/v2';
+
+function getEnvVar(account: string, key: string): string {
+ const envKey = `LINKEDIN_${account.toUpperCase()}_${key}`;
+ return process.env[envKey] ?? '';
+}
+
+function getAccessToken(account: string): string {
+ return getEnvVar(account, 'ACCESS_TOKEN');
+}
+
+async function linkedinRequest(
+ endpoint: string,
+ accessToken: string,
+ method: 'GET' | 'POST' = 'GET',
+ body?: unknown
+) {
+ const url = `${LINKEDIN_API_BASE}${endpoint}`;
+ const res = await fetch(url, {
+ method,
+ headers: {
+ 'Authorization': `Bearer ${accessToken}`,
+ 'Content-Type': 'application/json',
+ 'X-Restli-Protocol-Version': '2.0.0',
+ },
+ body: body ? JSON.stringify(body) : undefined,
+ signal: AbortSignal.timeout(15000),
+ });
+
+ if (!res.ok) {
+ const error = await res.text();
+ throw new Error(`LinkedIn API error (${res.status}): ${error}`);
+ }
+
+ return res.json();
+}
+
+export async function getProfile(args: { account?: string }): Promise<{
+ id: string;
+ firstName: string;
+ lastName: string;
+ email: string;
+ picture?: string;
+}> {
+ const accessToken = getAccessToken(args.account ?? 'default');
+ if (!accessToken) {
+ throw new Error('Missing LinkedIn credentials. Set LINKEDIN_{ACCOUNT}_ACCESS_TOKEN');
+ }
+
+ // OpenID Connect userinfo endpoint (works with profile scope)
+ const res = await fetch(`${LINKEDIN_API_BASE}/userinfo`, {
+ headers: {
+ 'Authorization': `Bearer ${accessToken}`,
+ },
+ signal: AbortSignal.timeout(15000),
+ });
+
+ if (!res.ok) {
+ const error = await res.text();
+ throw new Error(`LinkedIn API error (${res.status}): ${error}`);
+ }
+
+ const data = await res.json();
+ return {
+ id: data.sub,
+ firstName: data.given_name ?? '',
+ lastName: data.family_name ?? '',
+ email: data.email ?? '',
+ picture: data.picture ?? '',
+ };
+}
+
+export async function createPost(args: {
+ text: string;
+ visibility?: 'PUBLIC' | 'CONNECTIONS';
+ account?: string;
+}): Promise<{ success: boolean; post_id: string; url: string }> {
+ const accessToken = getAccessToken(args.account ?? 'default');
+ if (!accessToken) {
+ throw new Error('Missing LinkedIn credentials. Set LINKEDIN_{ACCOUNT}_ACCESS_TOKEN');
+ }
+
+ const profile = await getProfile({ account: args.account });
+ const authorUrn = `urn:li:person:${profile.id}`;
+
+ const body = {
+ author: authorUrn,
+ lifecycleState: 'PUBLISHED',
+ specificContent: {
+ 'com.linkedin.ugc.ShareContent': {
+ shareCommentary: {
+ text: args.text,
+ },
+ shareMediaCategory: 'NONE',
+ },
+ },
+ visibility: {
+ 'com.linkedin.ugc.MemberNetworkVisibility': args.visibility ?? 'PUBLIC',
+ },
+ };
+
+ const data = await linkedinRequest('/ugcPosts', accessToken, 'POST', body);
+ const postId = data.id ?? '';
+ return {
+ success: true,
+ post_id: postId,
+ url: postId ? `https://www.linkedin.com/feed/update/${postId}` : '',
+ };
+}
+
+export async function searchConnections(args: {
+ keywords?: string;
+ account?: string;
+}): Promise<{ message: string }> {
+ const accessToken = getAccessToken(args.account ?? 'default');
+ if (!accessToken) {
+ throw new Error('Missing LinkedIn credentials. Set LINKEDIN_{ACCOUNT}_ACCESS_TOKEN');
+ }
+
+ throw new Error(
+ 'LinkedIn connections search requires the LinkedIn Partnership Program. ' +
+ 'Public API access to connections was removed. ' +
+ 'Apply at https://developer.linkedin.com/partner-programs'
+ );
+}
+
+export async function sendMessage(args: {
+ recipient_id: string;
+ message: string;
+ account?: string;
+}): Promise<{ message: string }> {
+ const accessToken = getAccessToken(args.account ?? 'default');
+ if (!accessToken) {
+ throw new Error('Missing LinkedIn credentials. Set LINKEDIN_{ACCOUNT}_ACCESS_TOKEN');
+ }
+
+ throw new Error(
+ 'LinkedIn messaging requires the LinkedIn Partnership Program. ' +
+ 'Direct messaging is not available through the public API. ' +
+ 'Apply at https://developer.linkedin.com/partner-programs'
+ );
+}
diff --git a/src/clients/whatsapp.ts b/src/clients/whatsapp.ts
new file mode 100644
index 0000000..081ce72
--- /dev/null
+++ b/src/clients/whatsapp.ts
@@ -0,0 +1,145 @@
+
+
+const WHATSAPP_API_VERSION = 'v18.0';
+const WHATSAPP_BASE_URL = process.env['WHATSAPP_API_BASE_URL'] ?? 'https://graph.facebook.com';
+
+function getEnvVar(prefix: string, account: string, key: string): string {
+ const envKey = `WHATSAPP_${account.toUpperCase()}_${key}`;
+ return process.env[envKey] ?? '';
+}
+
+function getPhoneNumberId(account: string): string {
+ return getEnvVar('WHATSAPP', account, 'PHONE_NUMBER_ID');
+}
+
+function getAccessToken(account: string): string {
+ return getEnvVar('WHATSAPP', account, 'ACCESS_TOKEN');
+}
+
+function getBusinessAccountId(account: string): string {
+ return getEnvVar('WHATSAPP', account, 'BUSINESS_ACCOUNT_ID');
+}
+
+interface WhatsAppMessageResponse {
+ messaging_product: string;
+ contacts?: Array<{ wa_id: string; input: string }>;
+ messages?: Array<{ id: string }>;
+}
+
+async function whatsappApiRequest(
+ phoneId: string,
+ accessToken: string,
+ endpoint: string,
+ method: 'GET' | 'POST' = 'POST',
+ body?: unknown
+) {
+ const url = `${WHATSAPP_BASE_URL}/${WHATSAPP_API_VERSION}/${phoneId}/${endpoint}`;
+ const res = await fetch(url, {
+ method,
+ headers: {
+ 'Authorization': `Bearer ${accessToken}`,
+ 'Content-Type': 'application/json',
+ },
+ body: body ? JSON.stringify(body) : undefined,
+ signal: AbortSignal.timeout(10000),
+ });
+
+ if (!res.ok) {
+ const error = await res.text();
+ throw new Error(`WhatsApp API error (${res.status}): ${error}`);
+ }
+
+ return res.json();
+}
+
+export async function sendMessage(args: { to: string; message: string; account?: string }): Promise<{ success: boolean; message_id: string }> {
+ const phoneId = getPhoneNumberId(args.account ?? 'default');
+ const accessToken = getAccessToken(args.account ?? 'default');
+
+ if (!phoneId || !accessToken) {
+ throw new Error('Missing WhatsApp credentials. Set WHATSAPP_{ACCOUNT}_PHONE_NUMBER_ID and WHATSAPP_{ACCOUNT}_ACCESS_TOKEN');
+ }
+
+ const body = {
+ messaging_product: 'whatsapp',
+ to: args.to,
+ type: 'text',
+ text: { body: args.message },
+ };
+
+ const data = await whatsappApiRequest(phoneId, accessToken, 'messages', 'POST', body);
+ const response = data as WhatsAppMessageResponse;
+ return { success: true, message_id: response.messages?.[0]?.id ?? '' };
+}
+
+export async function sendTemplate(args: { to: string; template_name: string; language?: string; components?: unknown[]; account?: string }): Promise<{ success: boolean; message_id: string }> {
+ const phoneId = getPhoneNumberId(args.account ?? 'default');
+ const accessToken = getAccessToken(args.account ?? 'default');
+
+ if (!phoneId || !accessToken) {
+ throw new Error('Missing WhatsApp credentials. Set WHATSAPP_{ACCOUNT}_PHONE_NUMBER_ID and WHATSAPP_{ACCOUNT}_ACCESS_TOKEN');
+ }
+
+ const body: Record
= {
+ messaging_product: 'whatsapp',
+ to: args.to,
+ type: 'template',
+ template: {
+ name: args.template_name,
+ language: { code: args.language ?? 'en' },
+ },
+ };
+
+ if (args.components) {
+ (body.template as Record).components = args.components;
+ }
+
+ const data = await whatsappApiRequest(phoneId, accessToken, 'messages', 'POST', body);
+ const response = data as WhatsAppMessageResponse;
+ return { success: true, message_id: response.messages?.[0]?.id ?? '' };
+}
+
+export async function getMessageStatus(args: { message_id: string; account?: string }): Promise<{ message_id: string; status: string; timestamp?: string }> {
+ const phoneId = getPhoneNumberId(args.account ?? 'default');
+ const accessToken = getAccessToken(args.account ?? 'default');
+
+ if (!phoneId || !accessToken) {
+ throw new Error('Missing WhatsApp credentials. Set WHATSAPP_{ACCOUNT}_PHONE_NUMBER_ID and WHATSAPP_{ACCOUNT}_ACCESS_TOKEN');
+ }
+
+ // Note: Meta Cloud API doesn't support polling message status via GET
+ // Status updates are only available via webhooks (push-based)
+ throw new Error('whatsapp_get_message_status is not supported. Meta Cloud API only provides delivery status via webhooks. Use POST /api/whatsapp/webhook to receive status updates.');
+}
+
+export async function listTemplates(args: { account?: string }): Promise<{ templates: Array<{ name: string; language: string; status: string }> }> {
+ const account = args.account ?? 'default';
+ const businessAccountId = getBusinessAccountId(account);
+ const accessToken = getAccessToken(account);
+
+ if (!businessAccountId || !accessToken) {
+ throw new Error('Missing WhatsApp credentials. Set WHATSAPP_{ACCOUNT}_BUSINESS_ACCOUNT_ID and WHATSAPP_{ACCOUNT}_ACCESS_TOKEN');
+ }
+
+ const url = `${WHATSAPP_BASE_URL}/${WHATSAPP_API_VERSION}/${businessAccountId}/message_templates?fields=name,language,status`;
+ const res = await fetch(url, {
+ headers: {
+ 'Authorization': `Bearer ${accessToken}`,
+ },
+ signal: AbortSignal.timeout(10000),
+ });
+
+ if (!res.ok) {
+ const error = await res.text();
+ throw new Error(`WhatsApp API error (${res.status}): ${error}`);
+ }
+
+ const data = await res.json();
+ return {
+ templates: (data.data ?? []).map((t: { name: string; language: string | { code: string }; status: string }) => ({
+ name: t.name,
+ language: typeof t.language === 'string' ? t.language : t.language?.code ?? 'en',
+ status: t.status,
+ })),
+ };
+}
diff --git a/src/index.ts b/src/index.ts
index 3af9809..e0811d8 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -547,6 +547,82 @@ app.get('/api/obsidian/sync', requireAuth, async (_req, res) => {
}
});
+// ── WhatsApp Business API REST endpoints ──────────────────────────
+app.post('/api/whatsapp/send', requireAuth, async (req, res) => {
+ const { to, message, account } = req.body as Record;
+ if (!to || !message) { res.status(400).json({ error: 'to and message are required' }); return; }
+ try {
+ const result = await handleToolCall('whatsapp_send_message', { to, message, account });
+ res.json(parseToolResult(result));
+ } catch (err) {
+ res.status(500).json({ error: (err as Error).message });
+ }
+});
+
+app.post('/api/whatsapp/template', requireAuth, async (req, res) => {
+ const { to, template_name, language, components, account } = req.body as Record;
+ if (!to || !template_name) { res.status(400).json({ error: 'to and template_name are required' }); return; }
+ try {
+ const result = await handleToolCall('whatsapp_send_template', { to, template_name, language, components, account });
+ res.json(parseToolResult(result));
+ } catch (err) {
+ res.status(500).json({ error: (err as Error).message });
+ }
+});
+
+app.get('/api/whatsapp/templates', requireAuth, async (req, res) => {
+ const account = req.query.account as string | undefined;
+ try {
+ const result = await handleToolCall('whatsapp_list_templates', { account });
+ res.json(parseToolResult(result));
+ } catch (err) {
+ res.status(500).json({ error: (err as Error).message });
+ }
+});
+
+// ── LinkedIn REST endpoints ─────────────────────────────────────
+app.get('/api/linkedin/profile', requireAuth, async (req, res) => {
+ const account = req.query.account as string | undefined;
+ try {
+ const result = await handleToolCall('linkedin_get_profile', { account });
+ res.json(parseToolResult(result));
+ } catch (err) {
+ res.status(500).json({ error: (err as Error).message });
+ }
+});
+
+app.post('/api/linkedin/post', requireAuth, async (req, res) => {
+ const { text, visibility, account } = req.body as Record;
+ if (!text) { res.status(400).json({ error: 'text is required' }); return; }
+ try {
+ const result = await handleToolCall('linkedin_create_post', { text, visibility, account });
+ res.json(parseToolResult(result));
+ } catch (err) {
+ res.status(500).json({ error: (err as Error).message });
+ }
+});
+
+app.post('/api/linkedin/search-connections', requireAuth, async (req, res) => {
+ const { keywords, account } = req.body as Record;
+ try {
+ const result = await handleToolCall('linkedin_search_connections', { keywords, account });
+ res.json(parseToolResult(result));
+ } catch (err) {
+ res.status(500).json({ error: (err as Error).message });
+ }
+});
+
+app.post('/api/linkedin/message', requireAuth, async (req, res) => {
+ const { recipient_id, message, account } = req.body as Record;
+ if (!recipient_id || !message) { res.status(400).json({ error: 'recipient_id and message are required' }); return; }
+ try {
+ const result = await handleToolCall('linkedin_send_message', { recipient_id, message, account });
+ res.json(parseToolResult(result));
+ } catch (err) {
+ res.status(500).json({ error: (err as Error).message });
+ }
+});
+
app.post('/api/pilot-request', async (req, res) => {
const origin = req.get('origin');
if (origin && !SQUAREMCP_ALLOWED_ORIGINS.has(origin)) {
diff --git a/src/manifest.ts b/src/manifest.ts
index b710f61..0f8fea2 100644
--- a/src/manifest.ts
+++ b/src/manifest.ts
@@ -390,6 +390,183 @@ export function getManifest(serverUrl: string, authEnabled: boolean) {
],
},
+ // ── WhatsApp Business API tools ───────────────────────────────────────
+ {
+ name: 'whatsapp_send_message',
+ category: 'whatsapp',
+ description: 'Send a WhatsApp text message to a phone number',
+ when_to_use:
+ 'User asks to send a WhatsApp message, text someone on WhatsApp, or notify via WhatsApp. Only works if the recipient has messaged you within the last 24 hours.',
+ input_schema: {
+ type: 'object',
+ required: ['to', 'message'],
+ properties: {
+ to: { type: 'string', description: 'Recipient phone number in international format (e.g. +1234567890)' },
+ message: { type: 'string', description: 'Message text to send' },
+ account: { type: 'string', description: 'Which WhatsApp account to use (default: "default")' },
+ },
+ },
+ returns: {
+ type: 'object',
+ properties: {
+ success: { type: 'boolean' },
+ message_id: { type: 'string', description: 'WhatsApp message ID' },
+ },
+ },
+ examples: [{ to: '+1234567890', message: 'Hello from Hermes', account: 'default' }],
+ },
+ {
+ name: 'whatsapp_send_template',
+ category: 'whatsapp',
+ description: 'Send an approved WhatsApp template message',
+ when_to_use:
+ 'User wants to send a structured notification or alert via an approved WhatsApp template. Required when outside the 24-hour customer-service window.',
+ input_schema: {
+ type: 'object',
+ required: ['to', 'template_name'],
+ properties: {
+ to: { type: 'string', description: 'Recipient phone number in international format' },
+ template_name: { type: 'string', description: 'Name of the approved WhatsApp template' },
+ language: { type: 'string', description: 'Template language code (default: "en")' },
+ components: { type: 'array', description: 'Template components (header, body, buttons) with parameters' },
+ account: { type: 'string', description: 'Which WhatsApp account to use (default: "default")' },
+ },
+ },
+ returns: {
+ type: 'object',
+ properties: {
+ success: { type: 'boolean' },
+ message_id: { type: 'string', description: 'WhatsApp message ID' },
+ },
+ },
+ examples: [{ to: '+1234567890', template_name: 'hello_world', language: 'en', account: 'default' }],
+ },
+ {
+ name: 'whatsapp_list_templates',
+ category: 'whatsapp',
+ description: 'List all approved WhatsApp message templates for the business account',
+ when_to_use:
+ 'User asks what WhatsApp templates are available or wants to know which templates can be sent.',
+ input_schema: {
+ type: 'object',
+ properties: {
+ account: { type: 'string', description: 'Which WhatsApp account to use (default: "default")' },
+ },
+ },
+ returns: {
+ type: 'object',
+ properties: {
+ templates: {
+ type: 'array',
+ items: {
+ type: 'object',
+ properties: {
+ name: { type: 'string' },
+ language: { type: 'string' },
+ status: { type: 'string' },
+ },
+ },
+ },
+ },
+ },
+ examples: [{ account: 'default' }],
+ },
+
+ // ── LinkedIn tools ──────────────────────────────────────────────────────
+ {
+ name: 'linkedin_get_profile',
+ category: 'linkedin',
+ description: 'Get the LinkedIn profile of the authenticated user',
+ when_to_use:
+ 'User asks about their LinkedIn profile, name, headline, or wants to verify which LinkedIn account is connected.',
+ input_schema: {
+ type: 'object',
+ properties: {
+ account: { type: 'string', description: 'Which LinkedIn account to use (default: "default")' },
+ },
+ },
+ returns: {
+ type: 'object',
+ properties: {
+ id: { type: 'string', description: 'LinkedIn person ID (OpenID sub)' },
+ firstName: { type: 'string' },
+ lastName: { type: 'string' },
+ email: { type: 'string' },
+ picture: { type: 'string', description: 'Profile photo URL' },
+ },
+ },
+ examples: [{ account: 'default' }],
+ },
+ {
+ name: 'linkedin_create_post',
+ category: 'linkedin',
+ description: 'Create a post on LinkedIn',
+ when_to_use:
+ 'User wants to publish an update, share content, or post to their LinkedIn feed.',
+ input_schema: {
+ type: 'object',
+ required: ['text'],
+ properties: {
+ text: { type: 'string', description: 'Post content text' },
+ visibility: { type: 'string', enum: ['PUBLIC', 'CONNECTIONS'], description: 'PUBLIC (anyone) or CONNECTIONS (1st degree only)' },
+ account: { type: 'string', description: 'Which LinkedIn account to use (default: "default")' },
+ },
+ },
+ returns: {
+ type: 'object',
+ properties: {
+ success: { type: 'boolean' },
+ post_id: { type: 'string' },
+ url: { type: 'string', description: 'Direct link to the post' },
+ },
+ },
+ examples: [{ text: 'Excited to share our latest product update!', visibility: 'PUBLIC', account: 'default' }],
+ },
+ {
+ name: 'linkedin_search_connections',
+ category: 'linkedin',
+ description: 'Search LinkedIn connections [REQUIRES PARTNERSHIP]',
+ when_to_use:
+ 'User wants to search their LinkedIn network. NOTE: Requires LinkedIn Partnership Program — public API access was removed.',
+ input_schema: {
+ type: 'object',
+ properties: {
+ keywords: { type: 'string', description: 'Search keywords' },
+ account: { type: 'string', description: 'Which LinkedIn account to use (default: "default")' },
+ },
+ },
+ returns: {
+ type: 'object',
+ properties: {
+ message: { type: 'string', description: 'Error or guidance message' },
+ },
+ },
+ examples: [{ keywords: 'software engineer', account: 'default' }],
+ },
+ {
+ name: 'linkedin_send_message',
+ category: 'linkedin',
+ description: 'Send a direct message on LinkedIn [REQUIRES PARTNERSHIP]',
+ when_to_use:
+ 'User wants to send a LinkedIn DM. NOTE: Requires LinkedIn Partnership Program — messaging is not available through the public API.',
+ input_schema: {
+ type: 'object',
+ required: ['recipient_id', 'message'],
+ properties: {
+ recipient_id: { type: 'string', description: 'LinkedIn person URN or ID' },
+ message: { type: 'string', description: 'Message text' },
+ account: { type: 'string', description: 'Which LinkedIn account to use (default: "default")' },
+ },
+ },
+ returns: {
+ type: 'object',
+ properties: {
+ message: { type: 'string', description: 'Error or guidance message' },
+ },
+ },
+ examples: [{ recipient_id: 'urn:li:person:abc123', message: 'Hi, thanks for connecting!', account: 'default' }],
+ },
+
// ── Obsidian tools ──────────────────────────────────────────────────────
{
name: 'obsidian_search_notes',
@@ -549,6 +726,14 @@ export function getManifest(serverUrl: string, authEnabled: boolean) {
description: 'Email operations for Yahoo, FetcherPay, and Gmail accounts',
icon: '📧',
},
+ whatsapp: {
+ description: 'WhatsApp Business API messaging via Meta Cloud API',
+ icon: '💬',
+ },
+ linkedin: {
+ description: 'LinkedIn profile and posting via LinkedIn API',
+ icon: '🔗',
+ },
},
};
}
diff --git a/src/tools.ts b/src/tools.ts
index 2715081..4dd5cd9 100644
--- a/src/tools.ts
+++ b/src/tools.ts
@@ -2,6 +2,8 @@ import { Tool } from '@modelcontextprotocol/sdk/types.js';
import { searchMessages, readMessage, getProfile, listFolders, type Account } from './imap.js';
import { sendEmail, createDraft } from './smtp.js';
import { searchNotes, getNote, appendToNote, updateNote, getSyncStatus } from './clients/obsidian.js';
+import { sendMessage, sendTemplate, getMessageStatus, listTemplates } from './clients/whatsapp.js';
+import { getProfile as getLinkedInProfile, createPost as createLinkedInPost, searchConnections, sendMessage as sendLinkedInMessage } from './clients/linkedin.js';
const ACCOUNT_PARAM = {
account: {
@@ -174,6 +176,114 @@ export const tools: Tool[] = [
properties: {},
},
},
+
+ // ── WhatsApp Business API tools ────────────────────────────────
+ {
+ name: 'whatsapp_send_message',
+ description:
+ 'Send a WhatsApp message to a phone number. Use when the user asks to send a WhatsApp message, text someone on WhatsApp, or notify via WhatsApp.',
+ inputSchema: {
+ type: 'object',
+ properties: {
+ to: { type: 'string', description: 'Recipient phone number in international format (e.g. +1234567890)' },
+ message: { type: 'string', description: 'Message text to send' },
+ account: { type: 'string', description: 'Which WhatsApp account to use (default: "default")' },
+ },
+ required: ['to', 'message'],
+ },
+ },
+ {
+ name: 'whatsapp_send_template',
+ description:
+ 'Send a WhatsApp template message (for approved templates). Use when sending structured notifications or alerts via WhatsApp templates.',
+ inputSchema: {
+ type: 'object',
+ properties: {
+ to: { type: 'string', description: 'Recipient phone number in international format' },
+ template_name: { type: 'string', description: 'Name of the approved WhatsApp template' },
+ language: { type: 'string', description: 'Template language code (default: "en")' },
+ components: { type: 'array', description: 'Template components (header, body, buttons) with parameters' },
+ account: { type: 'string', description: 'Which WhatsApp account to use (default: "default")' },
+ },
+ required: ['to', 'template_name'],
+ },
+ },
+ {
+ name: 'whatsapp_get_message_status',
+ description:
+ '[DEPRECATED] Meta Cloud API does not support polling message status. Status updates are only available via webhooks.',
+ inputSchema: {
+ type: 'object',
+ properties: {
+ message_id: { type: 'string', description: 'WhatsApp message ID (not used - webhook required)' },
+ account: { type: 'string', description: 'Which WhatsApp account to use (default: "default")' },
+ },
+ },
+ },
+ {
+ name: 'whatsapp_list_templates',
+ description:
+ 'List all approved WhatsApp message templates for the business account. Use when the user asks what templates are available.',
+ inputSchema: {
+ type: 'object',
+ properties: {
+ account: { type: 'string', description: 'Which WhatsApp account to use (default: "default")' },
+ },
+ },
+ },
+
+ // ── LinkedIn tools ─────────────────────────────────────────────
+ {
+ name: 'linkedin_get_profile',
+ description:
+ 'Get the LinkedIn profile of the authenticated user. Use when the user asks about their LinkedIn profile, name, or headline.',
+ inputSchema: {
+ type: 'object',
+ properties: {
+ account: { type: 'string', description: 'Which LinkedIn account to use (default: "default")' },
+ },
+ },
+ },
+ {
+ name: 'linkedin_create_post',
+ description:
+ 'Create a post on LinkedIn. Use when the user wants to publish an update, article, or share content on LinkedIn.',
+ inputSchema: {
+ type: 'object',
+ properties: {
+ text: { type: 'string', description: 'Post content text' },
+ visibility: { type: 'string', enum: ['PUBLIC', 'CONNECTIONS'], description: 'Visibility: PUBLIC (anyone) or CONNECTIONS (1st degree only). Default: PUBLIC' },
+ account: { type: 'string', description: 'Which LinkedIn account to use (default: "default")' },
+ },
+ required: ['text'],
+ },
+ },
+ {
+ name: 'linkedin_search_connections',
+ description:
+ 'Search LinkedIn connections. [REQUIRES PARTNERSHIP] LinkedIn removed public API access to connections. This tool will guide you to apply for the Partnership Program.',
+ inputSchema: {
+ type: 'object',
+ properties: {
+ keywords: { type: 'string', description: 'Search keywords for connections' },
+ account: { type: 'string', description: 'Which LinkedIn account to use (default: "default")' },
+ },
+ },
+ },
+ {
+ name: 'linkedin_send_message',
+ description:
+ 'Send a direct message on LinkedIn. [REQUIRES PARTNERSHIP] LinkedIn messaging is not available through the public API. This tool will guide you to apply for the Partnership Program.',
+ inputSchema: {
+ type: 'object',
+ properties: {
+ recipient_id: { type: 'string', description: 'LinkedIn person URN or ID of the recipient' },
+ message: { type: 'string', description: 'Message text to send' },
+ account: { type: 'string', description: 'Which LinkedIn account to use (default: "default")' },
+ },
+ required: ['recipient_id', 'message'],
+ },
+ },
];
function acct(args: Record): Account {
@@ -245,6 +355,68 @@ export async function handleToolCall(
result = await getSyncStatus();
break;
+ // ── WhatsApp Business API ──────────────────────────────────
+ case 'whatsapp_send_message':
+ result = await sendMessage({
+ to: args.to as string,
+ message: args.message as string,
+ account: args.account as string | undefined,
+ });
+ break;
+
+ case 'whatsapp_send_template':
+ result = await sendTemplate({
+ to: args.to as string,
+ template_name: args.template_name as string,
+ language: args.language as string | undefined,
+ components: args.components as unknown[] | undefined,
+ account: args.account as string | undefined,
+ });
+ break;
+
+ case 'whatsapp_get_message_status':
+ result = await getMessageStatus({
+ message_id: args.message_id as string,
+ account: args.account as string | undefined,
+ });
+ break;
+
+ case 'whatsapp_list_templates':
+ result = await listTemplates({
+ account: args.account as string | undefined,
+ });
+ break;
+
+ // ── LinkedIn ───────────────────────────────────────────────
+ case 'linkedin_get_profile':
+ result = await getLinkedInProfile({
+ account: args.account as string | undefined,
+ });
+ break;
+
+ case 'linkedin_create_post':
+ result = await createLinkedInPost({
+ text: args.text as string,
+ visibility: (args.visibility as 'PUBLIC' | 'CONNECTIONS') ?? 'PUBLIC',
+ account: args.account as string | undefined,
+ });
+ break;
+
+ case 'linkedin_search_connections':
+ result = await searchConnections({
+ keywords: args.keywords as string | undefined,
+ account: args.account as string | undefined,
+ });
+ break;
+
+ case 'linkedin_send_message':
+ result = await sendLinkedInMessage({
+ recipient_id: args.recipient_id as string,
+ message: args.message as string,
+ account: args.account as string | undefined,
+ });
+ break;
+
// Legacy Yahoo-prefixed names — keep working for any cached Claude sessions
case 'yahoo_get_profile':
result = await getProfile('yahoo');