# How get the correct current work directory in mcp server?

**URL:** <https://forum.cursor.com/t/how-get-the-correct-current-work-directory-in-mcp-server/99215>\
**Category:** Help\
**Created:** [June 1, 2025, 12:52pm UTC](https://forum.cursor.com/t/how-get-the-correct-current-work-directory-in-mcp-server/99215 "2025-06-01T12:52:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HomyeeKing](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/homyeeking/32/60075_2.png) [@HomyeeKing](https://forum.cursor.com/u/HomyeeKing)\
**Post date:** [June 1, 2025, 12:52pm UTC](https://forum.cursor.com/t/how-get-the-correct-current-work-directory-in-mcp-server/99215/1 "2025-06-01T12:52:22Z")

</div>

I am working on a mcp server using `stdio` as transportation.

It needs to get the working directory to access the project files, but the return value of `process.cwd()` always the mcp servers location not the working directory.

Is there any way to let mcp server get the correct path?

---

<div class="post-metadata">

**Author:** ![HomyeeKing](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/homyeeking/32/60075_2.png) [@HomyeeKing](https://forum.cursor.com/u/HomyeeKing)\
**Post date:** [June 2, 2025, 7:34am UTC](https://forum.cursor.com/t/how-get-the-correct-current-work-directory-in-mcp-server/99215/2 "2025-06-02T07:34:01Z")

</div>

> **[Debugging - Model Context Protocol](https://modelcontextprotocol.io/docs/tools/debugging#working-directory)**
>
> A comprehensive guide to debugging Model Context Protocol (MCP) integrations
