open-index/open-npm huggingface dataset:
npm package: @posthero/mcp
Description: PostHero MCP server — schedule and publish social media posts from any MCP-compatible AI tool
Author: PostHero
Latest version: 0.1.0

# @posthero/mcp

MCP (Model Context Protocol) server for [PostHero](https://posthero.ai) — schedule and publish social media posts from Claude Desktop, Cursor, VS Code, Windsurf, and any MCP-compatible AI tool.

## Quick start

### 1. Get your API key

Sign up at [posthero.ai](https://posthero.ai) and grab your key from **Settings > API**.

### 2. Add to your MCP client

**Claude Desktop** — edit `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "posthero": {
      "command": "npx",
      "args": ["-y", "@posthero/mcp"],
      "env": {
        "POSTHERO_API_KEY": "pk_your_api_key_here"
      }
    }
  }
}
```

**Cursor** — edit `.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "posthero": {
      "command": "npx",
      "args": ["-y", "@posthero/mcp"],
      "env": {
        "POSTHERO_API_KEY": "pk_your_api_key_here"
      }
    }
  }
}
```

**VS Code** — edit `.vscode/mcp.json`:

```json
{
  "servers": {
    "posthero": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@posthero/mcp"],
      "env": {
        "POSTHERO_API_KEY": "pk_your_api_key_here"
      }
    }
  }
}
```

### 3. Use it

Ask your AI assistant to post to social media:

> "Schedule a LinkedIn post about our new feature launch for tomorrow at 9am"

> "Create a Twitter thread about the benefits of remote work and publish it now"

> "Show me my top-performing posts on Threads this month"

## Available tools

| Tool | Description |
|------|-------------|
| `list_accounts` | List connected social media accounts |
| `create_post` | Create, schedule, or publish a post |
| `list_posts` | List posts with filters (status, platform) |
| `get_post` | Get full details of a post |
| `update_post` | Update a draft or scheduled post |
| `delete_post` | Delete a post from PostHero |
| `publish_post` | Immediately publish a draft/scheduled post |
| `get_analytics_summary` | Aggregated analytics for a platform |
| `get_top_posts` | Top-performing posts ranked by metric |

## Supported platforms

LinkedIn, Twitter/X, Instagram, Facebook, YouTube, TikTok, Threads, Bluesky

## Environment variables

| Variable | Description |
|----------|-------------|
| `POSTHERO_API_KEY` | **Required.** Your PostHero API key (`pk_...`) |
| `POSTHERO_BASE_URL` | Override API base URL (default: `https://server.posthero.ai/api/v1`) |

## License

MIT
npm package: @posthog/advanced-geoip-app
Description: Advanced GeoIP filtering app for PostHog
Latest version: 0.0.7

<img src="logo.png" alt="Advanced GeoIP logo" width="120px" />

# PostHog Community App: Advanced GeoIP

This app extends functionality for the [GeoIP app](https://github.com/PostHog/posthog-plugin-geoip). This functionality cannot be part of the main GeoIP app as that app is stateless:

1. Enables discarding IP addresses after GeoIP lookup is processed. This is particularly helpful for privacy preservation and compliance. IP addresses are considered PII in several countries.
2. Enables discarding entire GeoIP information for events that come from certain libraries. For example, you probably don't want to assign locations to users that belong to your server. I've used it to ignore IP address and GeoIP information from my backend.

## 🚀 Usage

To use it simply install the app from the repository URL: https://github.com/paolodamico/posthog-app-advanced-geoip or search for it in the PostHog App Library.

## 🧑‍💻 Development & testing

Contributions are welcomed! Feel free to open a PR or an issue. To develop locally and contribute to this package, you can simply follow these instructions after cloning the repo.

-   Install dependencies
    ```bash
    yarn install
    ```
-   Run tests
    ```bash
    yarn test
    ```
-   Install app in your local instance by going to `/project/apps` in your PostHog instance, clicking on the "Advanced" tab and entering the full path where you cloned the repo. Please note that running apps locally on PostHog is currently buggy (see [posthog#7170](https://github.com/PostHog/posthog/issues/7170)).

## 🧑‍⚖️ License

This repository is MIT licensed. Please review the LICENSE file in this repository.

Copyright (C) 2022 Paolo D'Amico.
npm package: @posthog/agent-toolkit
Description: PostHog tools for AI agents
Author: PostHog Inc.
Latest version: 0.2.4
Deprecated: This was an attempt at exposing some of our internals for ease of use when integrating with the PostHog AI agent. We decided to implement the PostHog AI agent differently which means this package is not useful anymore. Please, do NOT use it in production, communicate with PostHog for AI purposes via our MCP.

# @posthog/agent-toolkit

Tools to give agents access to your PostHog data, manage feature flags, create insights, and more.

## Installation

```bash
npm install @posthog/agent-toolkit
```

## Quick Start

The toolkit provides integrations for popular AI frameworks:

### Using with Vercel AI SDK

```typescript
import { openai } from '@ai-sdk/openai'
import { generateText } from 'ai'

import { PostHogAgentToolkit } from '@posthog/agent-toolkit/integrations/ai-sdk'

const toolkit = new PostHogAgentToolkit({
  posthogPersonalApiKey: process.env.POSTHOG_PERSONAL_API_KEY!,
  posthogApiBaseUrl: 'https://us.posthog.com', // or https://eu.posthog.com if you are hosting in the EU
})

const result = await generateText({
  model: openai('gpt-4'),
  tools: await toolkit.getTools(),
  prompt:
    'Analyze our product usage by getting the top 5 most interesting insights and summarising the data from them.',
})
```

**[→ See full Vercel AI SDK example](https://github.com/PostHog/posthog/tree/master/products/mcp/examples/ai-sdk)**

### Using with LangChain.js

```typescript
import { ChatPromptTemplate, MessagesPlaceholder } from '@langchain/core/prompts'
import { ChatOpenAI } from '@langchain/openai'
import { AgentExecutor, createToolCallingAgent } from 'langchain/agents'

import { PostHogAgentToolkit } from '@posthog/agent-toolkit/integrations/langchain'

const toolkit = new PostHogAgentToolkit({
  posthogPersonalApiKey: process.env.POSTHOG_PERSONAL_API_KEY!,
  posthogApiBaseUrl: 'https://us.posthog.com', // or https://eu.posthog.com if you are hosting in the EU
})

const tools = await toolkit.getTools()
const llm = new ChatOpenAI({ model: 'gpt-4' })

const prompt = ChatPromptTemplate.fromMessages([
  ['system', 'You are a data analyst with access to PostHog analytics'],
  ['human', '{input}'],
  new MessagesPlaceholder('agent_scratchpad'),
])

const agent = createToolCallingAgent({ llm, tools, prompt })
const executor = new AgentExecutor({ agent, tools })

const result = await executor.invoke({
  input: 'Analyze our product usage by getting the top 5 most interesting insights and summarising the data from them.',
})
```

**[→ See full LangChain.js example](https://github.com/PostHog/posthog/tree/master/products/mcp/examples/langchain-js)**

## Available Tools

For a list of all available tools, please see the [docs](https://posthog.com/docs/model-context-protocol).
npm package: @posthog/ai
Description: PostHog Node.js AI integrations
Author: PostHog
Latest version: 7.14.0

# PostHog Node AI

TypeScript SDK for LLM observability with PostHog.

[SEE FULL DOCS](https://posthog.com/docs/ai-engineering/observability)

## Installation

```bash
npm install @posthog/ai
```

## Direct Provider Usage

```typescript
import { OpenAI } from '@posthog/ai'
import { PostHog } from 'posthog-node'

const phClient = new PostHog('<YOUR_PROJECT_API_KEY>', { host: 'https://us.i.posthog.com' })

const client = new OpenAI({
  apiKey: '<YOUR_OPENAI_API_KEY>',
  posthog: phClient,
})

const completion = await client.chat.completions.create({
  model: 'gpt-5-mini',
  messages: [{ role: 'user', content: 'Tell me a fun fact about hedgehogs' }],
  posthogDistinctId: 'user_123', // optional
  posthogTraceId: 'trace_123', // optional
  posthogProperties: { conversation_id: 'abc123', paid: true }, //optional
  posthogGroups: { company: 'company_id_in_your_db' }, // optional
  posthogPrivacyMode: false, // optional
})

console.log(completion.choices[0].message.content)

// YOU HAVE TO HAVE THIS OR THE CLIENT MAY NOT SEND EVENTS
await phClient.shutdown()
```

## OpenTelemetry

`@posthog/ai` provides a `PostHogTraceExporter` that sends OpenTelemetry traces to PostHog's OTLP ingestion endpoint. PostHog converts `gen_ai.*` spans into `$ai_generation` events server-side. This works with any LLM provider SDK that supports OpenTelemetry.

```bash
npm install @posthog/ai @opentelemetry/sdk-node @opentelemetry/exporter-trace-otlp-http
```

```typescript
import { NodeSDK } from '@opentelemetry/sdk-node'
import { generateText } from 'ai'
import { openai } from '@ai-sdk/openai'
import { PostHogTraceExporter } from '@posthog/ai/otel'

const sdk = new NodeSDK({
  traceExporter: new PostHogTraceExporter({
    apiKey: '<YOUR_PROJECT_API_KEY>',
    host: 'https://us.i.posthog.com', // optional, defaults to https://us.i.posthog.com
  }),
})
sdk.start()

const result = await generateText({
  model: openai('gpt-5-mini'),
  prompt: 'Write a short haiku about debugging',
  experimental_telemetry: {
    isEnabled: true,
    functionId: 'my-awesome-function',
    metadata: {
      posthog_distinct_id: 'user_123',
      conversation_id: 'abc123',
    },
  },
})

await sdk.shutdown()
```

LLM Observability [docs](https://posthog.com/docs/ai-engineering/observability)

Please see the main [PostHog docs](https://www.posthog.com/docs).

## Questions?

### [Check out our community page.](https://posthog.com/posts)
npm package: @posthog/app-dev-server
Description: Helpful tools for developing PostHog apps.
Latest version: 1.1.1

# PostHog `site.ts` local development server

## app-dev-sever

Run `npx @posthog/app-dev-sever` inside any folder with a `plugin.json`, and we'll do our best to spin up a local
app development environment.

### Site Apps

Currently only site apps are supported. See the [Pineapple Mode](https://github.com/PostHog/pineapple-mode-app)
example app for a working example.

![localhost](https://user-images.githubusercontent.com/53387/195459925-685a1243-3f2e-4bf8-82a6-1c6db6cf35dc.gif)