ChatGPT Obsidian MCP Proxy

ChatGPT Obsidian MCP Proxy

A local proxy that enables ChatGPT to access an Obsidian vault through the Obsidian Local REST API by tunneling via ngrok and adding the API key header.

Category
访问服务器

README

ChatGPT Obsidian MCP Proxy

A local proxy that lets ChatGPT connect to the Obsidian Local REST API MCP endpoint through a public HTTPS tunnel such as ngrok.

The proxy keeps your Obsidian API key on your machine. ChatGPT connects with No Auth, and this server adds the required Authorization: Bearer ... header before forwarding requests to Obsidian.

Goal

Connect ChatGPT to Obsidian so ChatGPT can search, read, create, and append notes using the Obsidian Local REST API MCP server.

Simple Explanation

There are four moving parts:

Component What it does Example
ChatGPT MCP client that wants to use tools ChatGPT App / Connector
ngrok Creates a public HTTPS URL https://xxxx.ngrok-free.app
Proxy server Adds the Obsidian API key automatically http://127.0.0.1:3000
Obsidian Stores and manages notes https://127.0.0.1:27124

Architecture

flowchart LR
    A[ChatGPT App] -->|No Auth| B[ngrok HTTPS URL]
    B --> C[Local Proxy Server :3000]
    C -->|Adds Authorization Bearer API Key| D[Obsidian Local REST API :27124]
    D --> E[(Obsidian Vault)]

Important Lesson

Do not paste the Obsidian API key into ChatGPT OAuth fields.

Obsidian Local REST API uses a bearer token:

Authorization: Bearer YOUR_OBSIDIAN_API_KEY

ChatGPT OAuth fields are for real OAuth URLs such as auth URL, token URL, and registration URL. They are not for static API keys.

Correct setup:

ChatGPT Authentication = No Auth
Proxy Server = Adds Obsidian API Key in the background

Requirements

  • ChatGPT Desktop app
  • Obsidian
  • Obsidian Local REST API community plugin
  • Node.js LTS
  • ngrok or another HTTPS tunnel

One-Time Setup Checklist

1. Set Up Obsidian

  • [ ] Install Obsidian.
  • [ ] Install the Local REST API community plugin.
  • [ ] Enable the plugin.
  • [ ] Copy the API key from Obsidian Settings > Local REST API > API Key.

Default Obsidian Local REST API endpoint:

https://127.0.0.1:27124

MCP endpoint:

https://127.0.0.1:27124/mcp/

2. Install Node.js

Install Node.js LTS.

Check installation:

node -v
npm -v

Expected result:

node version should appear
npm version should appear

3. Get This Project

Clone or download this repository, then open PowerShell in the project folder.

For example, if you cloned the repo into C:\Projects, go to:

cd "C:\Projects\chatgpt-obsidian-mcp-proxy"

4. Install Dependencies

npm install

5. Create Your Local .env File

Copy-Item .env.example .env

Edit .env and set:

OBSIDIAN_API_KEY=your_local_rest_api_key
OBSIDIAN_TARGET=https://127.0.0.1:27124
PORT=3000

Do not commit .env. It contains the secret token for your vault.

6. Install ChatGPT Desktop

Install and sign in to the ChatGPT Desktop app before creating the connector.

This setup uses ChatGPT Apps / Connectors in Developer Mode, which should be configured from the desktop app.

Daily Startup Procedure

Use this every time you want ChatGPT to connect to Obsidian.

Step 1: Start Obsidian

  • [ ] Open Obsidian.
  • [ ] Confirm the Local REST API plugin is enabled.

Test Obsidian directly:

curl.exe -k https://127.0.0.1:27124/

When the API key is included by the proxy later, the response should show:

"authenticated": true

Step 2: Start the Proxy Server

Open PowerShell in the project folder:

cd "C:\Projects\chatgpt-obsidian-mcp-proxy"

Start the proxy:

npm start

Expected output:

Obsidian MCP proxy running on http://127.0.0.1:3000
Forwarding to https://127.0.0.1:27124

Keep this PowerShell window open. The proxy stops if you close the window or press Ctrl+C.

Step 3: Test the Proxy

Open a second PowerShell window:

curl.exe http://127.0.0.1:3000/

Expected output should contain:

"authenticated": true

Then test the MCP endpoint:

curl.exe http://127.0.0.1:3000/mcp/ -H "Accept: text/event-stream"

Possible behavior:

  • It may keep the connection open.
  • It may show streaming/event output.
  • That is normal because MCP uses event streaming.

Step 4: Start ngrok

Open a third PowerShell window.

If ngrok.exe is in your current folder:

.\ngrok.exe http http://127.0.0.1:3000

If ngrok is available globally:

ngrok http http://127.0.0.1:3000

Expected output:

Forwarding  https://xxxx.ngrok-free.app -> http://127.0.0.1:3000

Copy the HTTPS URL.

Example:

https://3a94-xxxx.ngrok-free.app

Your ChatGPT MCP URL becomes:

https://3a94-xxxx.ngrok-free.app/mcp/

Always add /mcp/ at the end when giving the URL to ChatGPT.

ChatGPT App Configuration

Open the ChatGPT Desktop app.

Go to:

ChatGPT > Settings > Apps / Connectors > Developer Mode > Create App

Use:

Field Value
Name Obsidian Notes
Description Search, read, create, and append notes in my Obsidian vault.
Connection Server URL
Server URL https://YOUR-NGROK-URL.ngrok-free.app/mcp/
Authentication No Auth

Correct URL Format

Correct:

https://xxxx.ngrok-free.app/mcp/

Wrong:

https://xxxx.ngrok-free.app
https://127.0.0.1:27124/mcp/
http://127.0.0.1:3000/mcp/

Why:

  • ChatGPT cannot access your local 127.0.0.1.
  • ChatGPT needs a public HTTPS URL.
  • ngrok gives that public HTTPS URL.

Validation Flow

flowchart TD
    A[Start Obsidian] --> B[Test https://127.0.0.1:27124]
    B --> C[Start Proxy on Port 3000]
    C --> D[Test http://127.0.0.1:3000]
    D --> E{authenticated true?}
    E -->|No| F[Check API key in .env]
    E -->|Yes| G[Start ngrok to port 3000]
    G --> H[Copy HTTPS ngrok URL]
    H --> I[Add /mcp/]
    I --> J[Create ChatGPT App with No Auth]
    J --> K[Use Obsidian from ChatGPT]

Troubleshooting

Problem 1: ChatGPT Shows OAuth Fields

Meaning: ChatGPT is asking for OAuth setup.

Fix: Do not use OAuth. Use:

Authentication = No Auth

The proxy handles the Obsidian API key.

Problem 2: ngrok Shows Requests to /.well-known/... with 404

Example:

GET /.well-known/oauth-authorization-server 404
GET /.well-known/openid-configuration 404
GET /.well-known/oauth-protected-resource 404

Meaning: ChatGPT is trying OAuth discovery.

Fix: Set ChatGPT Authentication to No Auth and confirm the server URL ends with:

/mcp/

Problem 3: ngrok Shows POST / 404

Meaning: ChatGPT is calling the root path instead of the MCP path.

Fix: Your ChatGPT URL is probably missing /mcp/.

Use:

https://xxxx.ngrok-free.app/mcp/

Do not use:

https://xxxx.ngrok-free.app

Problem 4: Proxy Test Does Not Show authenticated: true

Run:

curl.exe http://127.0.0.1:3000/

If output shows:

"authenticated": false

Check:

  • Is Obsidian open?
  • Is Local REST API enabled?
  • Is the API key correct in .env?
  • Did you restart npm start after changing .env?

Problem 5: PowerShell Says curl -k Is Invalid

PowerShell treats curl as Invoke-WebRequest.

Use:

curl.exe -k https://127.0.0.1:27124/

Do not use:

curl -k https://127.0.0.1:27124/

Problem 6: MCP Endpoint Says Client Must Accept text/event-stream

Example error:

{"jsonrpc":"2.0","error":{"code":-32000,"message":"Not Acceptable: Client must accept text/event-stream"},"id":null}

Meaning: This is actually good. It means the MCP endpoint exists and expects event streaming.

Fix for manual testing:

curl.exe http://127.0.0.1:3000/mcp/ -H "Accept: text/event-stream"

Stop Everything Safely

To stop the proxy:

Go to the proxy PowerShell window and press Ctrl+C.

To stop ngrok:

Go to the ngrok PowerShell window and press Ctrl+C.

To fully shut down:

  • [ ] Stop ChatGPT usage.
  • [ ] Stop ngrok.
  • [ ] Stop proxy.
  • [ ] Close Obsidian if not needed.

Security Rules

Treat the ngrok URL like a temporary doorway into your Obsidian vault.

  • Do not share the ngrok URL.
  • Stop ngrok when not using it.
  • Stop the proxy when not using it.
  • Do not upload .env to GitHub.
  • Do not expose this permanently without stronger authentication.
  • Keep Obsidian vault backups.
  • Avoid enabling destructive tools like delete, move, or rename until you are comfortable.

Mental Model

flowchart LR
    A[Wrong Idea] --> B[Paste API key into OAuth fields]
    C[Correct Idea] --> D[Use No Auth in ChatGPT]
    D --> E[Proxy adds API key]
    E --> F[Obsidian accepts request]

Quick Command Cheat Sheet

Start proxy:

cd "C:\Projects\chatgpt-obsidian-mcp-proxy"
npm start

Test proxy:

curl.exe http://127.0.0.1:3000/

Start ngrok:

ngrok http http://127.0.0.1:3000

ChatGPT URL format:

https://YOUR-NGROK-URL.ngrok-free.app/mcp/

ChatGPT Authentication:

No Auth

Final Success Checklist

  • [ ] Obsidian is open.
  • [ ] Local REST API plugin is enabled.
  • [ ] .env contains the correct Obsidian API key.
  • [ ] Proxy is running on port 3000.
  • [ ] curl.exe http://127.0.0.1:3000/ shows authenticated: true.
  • [ ] ngrok is forwarding to http://127.0.0.1:3000.
  • [ ] ChatGPT server URL ends with /mcp/.
  • [ ] ChatGPT Authentication is No Auth.
  • [ ] ChatGPT connector creates successfully.

Final Target State

ChatGPT
  -> ngrok HTTPS URL /mcp/
  -> Local proxy on port 3000
  -> Obsidian Local REST API on port 27124
  -> Obsidian vault notes

Once this works, ChatGPT can help maintain notes, study plans, CTI dashboards, SOC investigation templates, and learning logs directly inside Obsidian.

Full Runbook

See docs/runbook.md for the repo-maintained setup runbook.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选