Skip to content

Commit 032d93b

Browse files
Merge pull request #39 from stickerdaniel/fix/uvx-import-structure
Fix import structure for uvx installation
2 parents c2acb17 + 2d692ce commit 032d93b

File tree

6 files changed

+18
-19
lines changed

6 files changed

+18
-19
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ RUN adduser -D -u 1000 mcpuser && chown -R mcpuser:mcpuser /app
2525
USER mcpuser
2626

2727
# Set entrypoint and default arguments
28-
ENTRYPOINT ["uv", "run", "main.py"]
28+
ENTRYPOINT ["uv", "run", "-m", "linkedin_mcp_server"]
2929
CMD []

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Suggest improvements for my CV to target this job posting https://www.linkedin.c
6464
"stickerdaniel/linkedin-mcp-server:latest"
6565
],
6666
"env": {
67-
"LINKEDIN_COOKIE": "XXXXXX..."
67+
"LINKEDIN_COOKIE": "li_at=YOUR_COOKIE_VALUE"
6868
}
6969
}
7070
}
@@ -120,7 +120,7 @@ Copy the cookie from the output and set it as `LINKEDIN_COOKIE` in your client c
120120
**HTTP Mode Example (for web-based MCP clients):**
121121
```bash
122122
docker run -it --rm \
123-
-e LINKEDIN_COOKIE="your_linkedin_cookie" \
123+
-e LINKEDIN_COOKIE="li_at=YOUR_COOKIE_VALUE" \
124124
-p 8080:8080 \
125125
stickerdaniel/linkedin-mcp-server:latest \
126126
--transport streamable-http --host 0.0.0.0 --port 8080 --path /mcp
@@ -216,7 +216,7 @@ If you have [uv](https://docs.astral.sh/uv/) installed, you can run the LinkedIn
216216
uvx --from git+https://github.com/stickerdaniel/linkedin-mcp-server linkedin-mcp-server --help
217217

218218
# Run with your LinkedIn cookie
219-
uvx --from git+https://github.com/stickerdaniel/linkedin-mcp-server linkedin-mcp-server --cookie "your_linkedin_cookie"
219+
uvx --from git+https://github.com/stickerdaniel/linkedin-mcp-server linkedin-mcp-server --cookie "li_at=YOUR_COOKIE_VALUE"
220220
```
221221

222222
**Client Configuration for uvx:**
@@ -231,7 +231,7 @@ uvx --from git+https://github.com/stickerdaniel/linkedin-mcp-server linkedin-mcp
231231
"linkedin-mcp-server"
232232
],
233233
"env": {
234-
"LINKEDIN_COOKIE": "your_linkedin_cookie_here"
234+
"LINKEDIN_COOKIE": "li_at=YOUR_COOKIE_VALUE"
235235
}
236236
}
237237
}
@@ -293,7 +293,7 @@ uv run pre-commit install
293293
# 5. Start the server once manually
294294
# You will be prompted to enter your LinkedIn credentials, and they will be securely stored in your OS keychain
295295
# Once logged in, your cookie will be stored in your OS keychain and used for subsequent runs until it expires
296-
uv run main.py --no-headless --no-lazy-init
296+
uv run -m linkedin_mcp_server --no-headless --no-lazy-init
297297
```
298298

299299
### Local Setup Help
@@ -316,7 +316,7 @@ uv run main.py --no-headless --no-lazy-init
316316

317317
**HTTP Mode Example (for web-based MCP clients):**
318318
```bash
319-
uv run main.py --transport streamable-http --host 127.0.0.1 --port 8000 --path /mcp
319+
uv run -m linkedin_mcp_server --transport streamable-http --host 127.0.0.1 --port 8000 --path /mcp
320320
```
321321

322322
**Claude Desktop:**
@@ -325,7 +325,7 @@ uv run main.py --transport streamable-http --host 127.0.0.1 --port 8000 --path /
325325
"mcpServers": {
326326
"linkedin": {
327327
"command": "uv",
328-
"args": ["--directory", "/path/to/linkedin-mcp-server", "run", "main.py"]
328+
"args": ["--directory", "/path/to/linkedin-mcp-server", "run", "-m", "linkedin_mcp_server"]
329329
}
330330
}
331331
}

linkedin_mcp_server/__main__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#!/usr/bin/env python3
22
"""Entry point for linkedin-mcp-server command."""
33

4-
# Import main function from the main module at package root
5-
import main
4+
from linkedin_mcp_server.cli_main import main
65

76
if __name__ == "__main__":
8-
main.main()
7+
main()

linkedin_mcp_server/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ def print_claude_config() -> None:
4646
"--directory",
4747
current_dir,
4848
"run",
49-
"main.py",
49+
"-m",
50+
"linkedin_mcp_server",
5051
"--no-setup",
5152
]
5253

main.py renamed to linkedin_mcp_server/cli_main.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# main.py
1+
# linkedin_mcp_server/cli_main.py
22
"""
3-
LinkedIn MCP Server - Main application entry point.
3+
LinkedIn MCP Server - Main CLI application entry point.
44
55
Implements a three-phase startup:
66
1. Authentication Setup Phase - Credential validation and session establishment
@@ -278,7 +278,9 @@ def get_version() -> str:
278278
import os
279279
import tomllib
280280

281-
pyproject_path = os.path.join(os.path.dirname(__file__), "pyproject.toml")
281+
pyproject_path = os.path.join(
282+
os.path.dirname(os.path.dirname(__file__)), "pyproject.toml"
283+
)
282284
with open(pyproject_path, "rb") as f:
283285
data = tomllib.load(f)
284286
return data["project"]["version"]

pyproject.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,12 @@ dependencies = [
1313
]
1414

1515
[project.scripts]
16-
linkedin-mcp-server = "main:main"
16+
linkedin-mcp-server = "linkedin_mcp_server.cli_main:main"
1717

1818
[build-system]
1919
requires = ["setuptools>=68.0", "wheel"]
2020
build-backend = "setuptools.build_meta"
2121

22-
[tool.setuptools]
23-
py-modules = ["main"]
24-
2522
[tool.setuptools.packages.find]
2623
include = ["linkedin_mcp_server*"]
2724
exclude = ["assets*", "docs*", "tests*"]

0 commit comments

Comments
 (0)