Skip to main content
Glama
junoonx

Territory News MCP Server

by junoonx
README.md
# Territory News MCP Server πŸš€
> **Model Context Protocol (MCP) Server for [Territory News](https://territory.news/)** β€” Real-time Account Intelligence, Deal Signals & Strategic Openers for Enterprise Sales & Account Executives.

---

## 🎯 Overview

**Territory News MCP (`tnews-mcp`)** frees Account Executives (AEs) and sales teams from being chained to the manual Territory News web UI. By exposing territory configuration, company search, real-time signal preview, and AI-enriched seller context over the open **Model Context Protocol (MCP)** standard, `tnews-mcp` allows autonomous orchestratorsβ€”such as **n8n**, **OpenClaw**, **Agentic Hermes**, **Claude Desktop**, **Cursor**, **Gemini**, and custom **Slack AI Agents**β€”to continuously execute high-leverage sales workflows in the background.

```mermaid
graph TD
    subgraph "MCP Ecosystem"
        Cal_MCP["Calendar MCP<br/>(Google / Outlook)"]
        T_MCP["Territory News MCP<br/>(Signals, POV, Openers, Tracking)"]
        C_MCP["CRM MCP<br/>(Salesforce / HubSpot)"]
        E_MCP["Email MCP<br/>(Gmail / Outlook)"]
    end

    subgraph "Autonomous Orchestration Layer (n8n / OpenClaw / Hermes Agent / Claude)"
        LLM["LLM Reasoning & Strategy Engine<br/>(Claude / Gemini / Llama / Hermes)"]
    end

    Cal_MCP -->|"Upcoming Meetings & Attendees"| LLM
    T_MCP -->|"Account News, Executive Moves, Triggers"| LLM
    C_MCP -->|"Pipeline Stages, Account Tier, Notes"| LLM
    E_MCP -->|"Outreach Drafts & Sequences"| LLM

    LLM --> W1["β˜• 8:00 AM Morning Intelligence Briefing"]
    LLM --> W2["⚑ 5-Minute Pre-Call Battlecard Generator"]
    LLM --> W3["🎯 Trigger-Based Stalled Deal Reactivation"]
    LLM --> W4["πŸ‘₯ Multi-Threading Consensus Matrix"]
    LLM --> W5["πŸ”„ Closed-Loop Feedback & Relevance Tuning"]
```

---

## ⚑ The 5 Autonomous Agent Workflows (Freeing You from the UI)

Instead of logging into `territory.news` every morning to manually click through accounts and copy openers, connect `tnews-mcp` to your multi-agent runner (n8n cron trigger, OpenClaw agent, or Hermes):

### 1. β˜• 8:00 AM Morning Intelligence Briefing & Action Queue
* **How It Works**: Every morning at 8:00 AM, an **n8n / OpenClaw** cron job awakens your sales agent.
* **Orchestration**:
  1. The agent calls **CRM MCP** to fetch your active pipeline (Stages 2–4) and top Tier-1 target accounts.
  2. It invokes **`territory_get_signals`** on `tnews-mcp` to scan for material catalysts over the last 24 hours (e.g., CapEx expansion, CIO hires, earnings surprises, restructuring).
  3. It cross-references your configured seller value proposition (`territory_get_seller_context`) and synthesizes a 3-item Slack digest with **1-click pre-drafted outreach emails**.
* **AE Impact**: You wake up to prioritized, ready-to-send outreach in Slack rather than combing through Google Alerts or web tabs.

---

### 2. ⚑ 5-Minute Pre-Call Battlecard Generator
* **How It Works**: 10 minutes prior to any calendar event, your agent triggers automatically.
* **Orchestration**:
  1. **Calendar MCP** detects an upcoming meeting (e.g., *"Discovery with VP of Engineering at Datadog"*).
  2. Agent calls **`territory_preview_signals(company="Datadog", domain="datadoghq.com")`** to pull breaking news and financial catalysts.
  3. Agent calls **CRM MCP** to fetch previous call objections and notes.
  4. Agent delivers a 1-page tactical battlecard to your inbox or scratchpad containing:
     - **Strategic Imperatives**: What the account is currently navigating.
     - **Persona Top-of-Mind**: Key KPIs and friction points for the attendee's role.
     - **3 Provocative Openers**: POV-led conversation starters directly connecting their public news to your product.
     - **Landmines**: Competitor presence or sensitive topics to avoid.

---

### 3. 🎯 Trigger-Based Stalled Deal Reactivation
* **How It Works**: Re-engaging ghosted or closed-lost deals with authentic value instead of "just checking in".
* **Orchestration**:
  1. Agent queries **CRM MCP** for deals in *Stalled / No Contact > 30 Days* with ARR > $50k.
  2. Agent queries **`territory_get_signals`** for major inflection events (e.g., new executive hires, earnings beats, M&A, regulatory changes).
  3. When an event fires (e.g., *"EquipmentShare Jumps on 26% Revenue Growth"*), the agent drafts a contextual follow-up connecting the growth to solving the specific bottleneck documented in CRM notes.

---

### 4. πŸ‘₯ Multi-Threading Consensus Matrix
* **How It Works**: Enterprise deals require consensus across 6–10 stakeholders.
* **Orchestration**:
  1. When a single major catalyst is identified for a target account via `tnews-mcp`, the agent automatically maps the event to distinct personas:
     - **To CFO**: Cost containment, OPEX reduction, and vendor consolidation angles.
     - **To CISO / Security**: Compliance automation, zero-trust architecture, and audit risk reduction.
     - **To VP Engineering**: Developer velocity, eliminating deployment toil, and DORA metric acceleration.
  2. The agent queues tailored outreach drafts in your email client via **Email MCP**.

---

### 5. πŸ”„ Closed-Loop Feedback & Relevance Tuning
* **How It Works**: Continuous improvement of signal quality without manual configuration.
* **Orchestration**:
  1. When you accept, edit, or reject an outreach recommendation in Slack or Claude, the agent automatically invokes **`territory_submit_feedback`** on `tnews-mcp`.
  2. This provides immediate closed-loop telemetry back to Territory News to tune signal scoring and relevance models for your territory over time.

---

## πŸ—οΈ Architecture: Hybrid Browser Auth + Direct REST API

This MCP server uses a **high-performance hybrid architecture**:
1. **One-Time Browser Login**: Launches a visible browser window once to sign in via Clerk (Work Email / Google SSO). It automatically captures the session token and saves it locally to `~/.territory-mcp/session.json`.
2. **100% Direct REST API**: All subsequent operations run via lightning-fast HTTP REST requests directly against Territory News endpoints (`< 150ms` latency, zero browser overhead, completely immune to DOM/UI changes).

---

## πŸš€ Quickstart

### 1. Installation

```bash
# Clone the repository
git clone https://github.com/junoonx/tnews-mcp.git
cd tnews-mcp

# Install dependencies and build
npm install
npm run build
```

### 2. Connect to Your AI Host / Orchestrator

#### A. Claude Desktop
Add this to your `claude_desktop_config.json` (located at `~/Library/Application Support/Claude/claude_desktop_config.json` on macOS or `%APPDATA%\Claude\claude_desktop_config.json` on Windows):

```json
{
  "mcpServers": {
    "territory-news": {
      "command": "node",
      "args": ["/absolute/path/to/tnews-mcp/dist/index.js"]
    }
  }
}
```

#### B. Cursor IDE / Cline / Windsurf
Add to your `.cursor/mcp.json` or MCP settings:

```json
{
  "mcpServers": {
    "territory-news": {
      "command": "node",
      "args": ["/absolute/path/to/tnews-mcp/dist/index.js"]
    }
  }
}
```

#### C. n8n / OpenClaw / Agentic Hermes / Docker
Pass the stdio command or set `TERRITORY_SESSION_TOKEN` in your environment:

```bash
TERRITORY_SESSION_TOKEN="your_clerk_session_jwt" node dist/index.js
```

---

## πŸ” Authentication

### Method 1: Interactive Browser Login (Recommended)
Ask your AI assistant in Claude/Cursor:
> *"Log in to Territory News"*

The server will invoke `territory_login_browser`, opening a browser window to `territory.news`. Log in with your work email or SSO. The browser will automatically save your session to `~/.territory-mcp/session.json` and close itself.

Alternatively, you can run it directly from your terminal:
```bash
npm run login
```

### Method 2: Headless Environment Variable
You can provide your session token directly:
```bash
export TERRITORY_SESSION_TOKEN="your_clerk_session_jwt_or_cookie"
```

---

## πŸ› οΈ MCP Tools Reference

| Tool Name | Parameters | Description |
| :--- | :--- | :--- |
| `territory_auth_status` | *(none)* | Check authentication state, user email, and tracked accounts count. |
| `territory_login_browser` | `timeoutSeconds` *(opt)* | Opens visible browser window for one-time Clerk sign-in. |
| `territory_logout` | *(none)* | Clears saved session credentials from local storage. |
| `territory_search_companies` | `query`, `limit` *(opt)* | Search public/private companies with fuzzy name matching. |
| `territory_preview_signals` | `company`, `domain` *(opt)* | Preview qualified real-time signals/headlines for any company. |
| `territory_get_tracked_companies` | *(none)* | List all currently monitored companies in your territory (1–10 accounts). |
| `territory_update_tracked_companies` | `action` (`add`\|`remove`\|`set`), `companies` | Add, remove, or replace accounts in your monitored territory. |
| `territory_get_seller_context` | *(none)* | View your active seller persona, role, product, and value proposition. |
| `territory_set_seller_context` | `sellingProduct`, `primaryUseCase`, `valueCreated`, `role` *(opt)*, `persona` *(opt)* | Configure sales context & trigger AI context enrichment. |
| `territory_get_signals` | `company` *(opt)* | Fetch real-time signals, strategic POVs, and deal openers for territory accounts. |
| `territory_trigger_scan` | *(none)* | Triggers a live re-scan of news and deal triggers across all territory accounts. |
| `territory_submit_feedback` | `feedbackType`, `message`, `sectionLabel` *(opt)* | Submit feedback to improve signal relevance and AI deal openers. |

---

## πŸ’‘ Example Prompts to Try with Your Agent

### 1. Pre-Call Discovery Battlecard
> *"I have a 2:00 PM discovery call with Datadog. Check my Territory News signals for Datadog, map them to my seller context, and give me a 1-page pre-call battlecard with 3 high-impact conversation openers."*

### 2. Territory Account Setup
> *"Search for Snowflake, Datadog, Stripe, and HashiCorp on Territory News and add them to my monitored territory."*

### 3. Seller Profile Alignment
> *"Update my Territory News seller context: I am an Enterprise AE selling an AI observability & FinOps platform. My primary use case is reducing cloud migration risk and Kubernetes egress waste. My value proposition is: 'We help enterprise platform teams prevent unexpected multi-cloud egress spikes and optimize compute utilization without manual SRE tuning.'"*

### 4. Monday Morning Deal Trigger Briefing
> *"Run a scan on all my Territory accounts. Show me the top 3 high-leverage inflection events (earnings, leadership changes, product shifts) and draft a 1-click personalized email for each."*

---

## πŸ“„ License
MIT License. Built for high-performing sellers and modern sales engineering teams.

TDQS

A3.8/5.0

Scored across 12 tools

Disambiguation4/5

Most tools map to distinct resources and actions: auth lifecycle, company search, tracked-company management, seller context, and signal retrieval are clearly separated. There is minor overlap between preview_signals and get_signals since get_signals can also target specific companies, though the intended pre-add versus tracked-account use case helps.

Naming Consistency4/5

All tools share a consistent territory_ prefix and nearly all follow a verb_noun structure such as search_companies, get_tracked_companies, and set_seller_context. Small deviations like territory_auth_status and territory_login_browser weaken the verb-first pattern slightly, but the overall convention remains predictable.

Tool Count5/5

12 tools is a well-scoped size for a territory intelligence MCP server, with separate groups for auth, company lookup, territory management, seller context, signals, and feedback. Each tool has a distinct responsibility and none feel redundant.

Completeness5/5

The surface covers the full workflow: authentication, company discovery, signal preview before adding, tracked-company management, seller context configuration, signal retrieval, live rescans, and feedback submission. There are no obvious dead ends or missing lifecycle operations.

Maintenance

ActivityMaintained
ResponsivenessNo issues