auth.md

peterhaddy.com is a public information resource on psychedelic-affirming psychotherapy by Dr. Peter H. Addy, LPC. All published content is freely accessible without authentication. Authenticated write access uses WordPress.com OAuth.

1. Discover

This site publishes standard OAuth discovery metadata. Fetch the documents directly or read the WWW-Authenticate header on a 401 response from any protected write endpoint.

Protected Resource Metadata

GET /.well-known/oauth-protected-resource HTTP/1.1
Host: peterhaddy.com
{
  "resource": "https://peterhaddy.com",
  "authorization_servers": ["https://public-api.wordpress.com/"],
  "scopes_supported": ["global", "auth"],
  "bearer_methods_supported": ["header"],
  "resource_documentation": "https://developer.wordpress.org/rest-api/"
}

Authorization Server Metadata

GET /.well-known/oauth-authorization-server HTTP/1.1
Host: peterhaddy.com

The authorization server is hosted at https://public-api.wordpress.com/. Fetch the full metadata document from the URL above. Key fields: issuer, authorization_endpoint, token_endpoint, grant_types_supported.

2. Access Model

ActionAuth required
Read pages, posts, mediaNone
WordPress REST API (GET)None
WordPress REST API (write)Bearer token — scope: global

Read any published content without a credential:

GET /wp-json/wp/v2/posts HTTP/1.1
Host: peterhaddy.com
GET /wp-json/wp/v2/pages HTTP/1.1
Host: peterhaddy.com

REST API reference: https://developer.wordpress.org/rest-api/

3. Agent Registration

This site does not operate a custom agent registration endpoint. Write access requires the WordPress.com OAuth 2.0 authorization code flow:

Most agent use cases — reading content, searching posts, navigation — require no credentials.

4. Revocation

Tokens issued through WordPress.com OAuth can be revoked via the standard OAuth revocation endpoint at WordPress.com. Revocation of provider-issued tokens follows the provider’s revocation event flow.

Contact

For integration questions: [email protected]

* controller.abort(), { once: true }); // ── Tool 1: Get practice information ──────────────────────────────────── navigator.modelContext.registerTool({ name: "get_practice_info", description: "Get information about Dr. Peter H. Addy's psychedelic-informed psychotherapy practice, including bio, credentials (LPC, PhD), specializations, and how to get in touch.", inputSchema: { type: "object", properties: {}, required: [], }, signal, execute: async () => { try { const [aboutPages, contactPages] = await Promise.all([ fetch("/wp-json/wp/v2/pages?slug=about&_fields=title,content,excerpt,link") .then((r) => r.json()) .catch(() => []), fetch("/wp-json/wp/v2/pages?slug=contact&_fields=title,content,link") .then((r) => r.json()) .catch(() => []), ]); return { name: "Dr. Peter H. Addy, LPC, PhD", specialization: "Psychedelic-Informed Psychotherapy", site: "https://peterhaddy.com", about: aboutPages[0] ? { title: stripHtml(aboutPages[0].title?.rendered), excerpt: stripHtml(aboutPages[0].excerpt?.rendered), url: aboutPages[0].link, } : null, contact: contactPages[0] ? { url: contactPages[0].link } : { url: "https://peterhaddy.com/contact/" }, }; } catch (err) { return { error: err.message }; } }, }); // ── Tool 2: Search site content ────────────────────────────────────────── navigator.modelContext.registerTool({ name: "search_content", description: "Search Dr. Addy's published articles and pages about psychedelic therapy, MDMA, psilocybin, ketamine, mental health, trauma, PTSD, and related topics.", inputSchema: { type: "object", properties: { query: { type: "string", description: 'Search terms, e.g. "MDMA therapy", "psilocybin depression", "ketamine"', }, limit: { type: "number", description: "Max results to return (default: 5, max: 20)", }, }, required: ["query"], }, signal, execute: async ({ query, limit = 5 }) => { const n = Math.min(Number(limit) || 5, 20); const q = encodeURIComponent(query); const fields = "_fields=id,title,excerpt,link,type,date"; try { const [posts, pages] = await Promise.all([ fetch(`/wp-json/wp/v2/posts?search=${q}&per_page=${n}&${fields}`) .then((r) => r.json()) .catch(() => []), fetch(`/wp-json/wp/v2/pages?search=${q}&per_page=${n}&${fields}`) .then((r) => r.json()) .catch(() => []), ]); const results = [...posts, ...pages] .slice(0, n) .map((item) => ({ title: stripHtml(item.title?.rendered), excerpt: stripHtml(item.excerpt?.rendered), url: item.link, type: item.type, date: item.date, })); return { query, count: results.length, results }; } catch (err) { return { query, error: err.message, results: [] }; } }, }); // ── Tool 3: Get recent articles ────────────────────────────────────────── navigator.modelContext.registerTool({ name: "get_recent_articles", description: "Get the most recent articles and blog posts from Dr. Addy about psychedelic therapy and mental health.", inputSchema: { type: "object", properties: { count: { type: "number", description: "Number of articles to return (default: 5, max: 20)", }, }, required: [], }, signal, execute: async ({ count = 5 }) => { const n = Math.min(Number(count) || 5, 20); try { const posts = await fetch( `/wp-json/wp/v2/posts?per_page=${n}&_fields=title,excerpt,link,date,categories` ) .then((r) => r.json()) .catch(() => []); return posts.map((p) => ({ title: stripHtml(p.title?.rendered), excerpt: stripHtml(p.excerpt?.rendered), url: p.link, date: p.date, })); } catch (err) { return { error: err.message }; } }, }); // ── Helper ─────────────────────────────────────────────────────────────── function stripHtml(html) { if (!html) return ""; return html .replace(/<[^>]+>/g, " ") .replace(/\s+/g, " ") .trim(); } })();