In build/index.js line 227, the comment even acknowledges the old assumption:
// Filter search results (data is directly an array)
constitems=response.data?.data||[];constfilteredItems=items.map((item)=>filterSearchResult(item));
items.map fails because items is now { items: [...] } not an array.
This handles both old and new API formats for backwards compatibility.
Environment
docmost-mcp: 1.0.1
Docmost: 0.80.2 (API change introduced in 0.25.0)
## Bug
The `search` tool throws `items.map is not a function` on Docmost 0.25.0+.
## Root Cause
Docmost changed the search API response format in v0.25.0 (February 2026):
- **Before 0.25.0:** `response.data.data` was a direct array
- **After 0.25.0:** `response.data.data` is now an object `{ items: [...], meta: {...} }`
Reference: https://github.com/docmost/docmost/discussions/1903
In `build/index.js` line 227, the comment even acknowledges the old assumption:
```js
// Filter search results (data is directly an array)
const items = response.data?.data || [];
const filteredItems = items.map((item) => filterSearchResult(item));
```
`items.map` fails because `items` is now `{ items: [...] }` not an array.
## Fix
```js
const data = response.data?.data;
const items = Array.isArray(data) ? data : data?.items || [];
const filteredItems = items.map((item) => filterSearchResult(item));
```
This handles both old and new API formats for backwards compatibility.
## Environment
- docmost-mcp: 1.0.1
- Docmost: 0.80.2 (API change introduced in 0.25.0)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Bug
The
searchtool throwsitems.map is not a functionon Docmost 0.25.0+.Root Cause
Docmost changed the search API response format in v0.25.0 (February 2026):
response.data.datawas a direct arrayresponse.data.datais now an object{ items: [...], meta: {...} }Reference: https://github.com/docmost/docmost/discussions/1903
In
build/index.jsline 227, the comment even acknowledges the old assumption:items.mapfails becauseitemsis now{ items: [...] }not an array.Fix
This handles both old and new API formats for backwards compatibility.
Environment