Skip to content

Commit 0b8c73d

Browse files
committed
Revert "Merge pull request #17 from stickerdaniel/feat/http-transport"
This reverts commit b4e800f, reversing changes made to fed12db.
1 parent a8086aa commit 0b8c73d

File tree

14 files changed

+111
-744
lines changed

14 files changed

+111
-744
lines changed

.vscode/tasks.json

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
11
{
22
"version": "2.0.0",
33
"tasks": [
4-
{
5-
"label": "bunx @modelcontextprotocol/inspector",
6-
"detail": "Run the Model Context Protocol Inspector",
7-
"type": "shell",
8-
"command": "bunx",
9-
"args": ["@modelcontextprotocol/inspector"],
10-
"group": {
11-
"kind": "test",
12-
"isDefault": true
13-
},
14-
"presentation": {
15-
"reveal": "always",
16-
"panel": "new",
17-
"focus": true
18-
},
19-
"problemMatcher": []
20-
},
214
{
225
"label": "uv run pre-commit run --all-files",
236
"detail": "Run pre-commit hooks on all files",
@@ -31,7 +14,7 @@
3114
],
3215
"group": {
3316
"kind": "test",
34-
"isDefault": false
17+
"isDefault": true
3518
},
3619
"presentation": {
3720
"reveal": "never",
@@ -74,38 +57,9 @@
7457
"--no-headless",
7558
"--no-lazy-init"
7659
],
77-
"group": {
78-
"kind": "build"
79-
},
80-
"presentation": {
81-
"reveal": "always",
82-
"panel": "new",
83-
"focus": true
84-
},
85-
"problemMatcher": []
86-
},
87-
{
88-
"label": "uv run main.py --transport streamable-http --no-setup",
89-
"detail": "Start HTTP MCP server on localhost:8000/mcp",
90-
"type": "shell",
91-
"command": "uv",
92-
"args": [
93-
"run",
94-
"main.py",
95-
"--transport",
96-
"streamable-http",
97-
"--host",
98-
"127.0.0.1",
99-
"--port",
100-
"8000",
101-
"--path",
102-
"/mcp",
103-
"--no-setup"
104-
],
105-
"isBackground": true,
10660
"group": {
10761
"kind": "build",
108-
"isDefault": false
62+
"isDefault": true
10963
},
11064
"presentation": {
11165
"reveal": "always",
@@ -132,6 +86,6 @@
13286
"focus": false
13387
},
13488
"problemMatcher": []
135-
},
89+
}
13690
]
13791
}

linkedin_mcp_server/cli.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
This module handles the command-line interface and configuration management.
66
"""
77

8-
import json
9-
import logging
8+
from typing import Dict, Any, List
109
import os
10+
import json
1111
import subprocess
12-
from typing import Any, Dict, List
13-
12+
import logging
1413
import pyperclip # type: ignore
1514

1615
from linkedin_mcp_server.config import get_config

linkedin_mcp_server/config/loaders.py

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,6 @@ def load_from_env(config: AppConfig) -> AppConfig:
4444
# Headless mode
4545
if os.environ.get("HEADLESS") in ("0", "false", "False", "no", "No"):
4646
config.chrome.headless = False
47-
elif os.environ.get("HEADLESS") in ("1", "true", "True", "yes", "Yes"):
48-
config.chrome.headless = True
49-
50-
# Non-interactive mode
51-
if os.environ.get("NON_INTERACTIVE") in ("1", "true", "True", "yes", "Yes"):
52-
config.chrome.non_interactive = True
53-
54-
# Lazy initialization
55-
if os.environ.get("LAZY_INIT") in ("1", "true", "True", "yes", "Yes"):
56-
config.server.lazy_init = True
57-
elif os.environ.get("LAZY_INIT") in ("0", "false", "False", "no", "No"):
58-
config.server.lazy_init = False
5947

6048
return config
6149

@@ -92,30 +80,9 @@ def load_from_args(config: AppConfig) -> AppConfig:
9280

9381
parser.add_argument(
9482
"--transport",
95-
choices=["stdio", "streamable-http"],
96-
default=None,
97-
help="Specify the transport mode (stdio or streamable-http)",
98-
)
99-
100-
parser.add_argument(
101-
"--host",
102-
type=str,
103-
default=None,
104-
help="HTTP server host (default: 127.0.0.1)",
105-
)
106-
107-
parser.add_argument(
108-
"--port",
109-
type=int,
110-
default=None,
111-
help="HTTP server port (default: 8000)",
112-
)
113-
114-
parser.add_argument(
115-
"--path",
116-
type=str,
83+
choices=["stdio", "sse"],
11784
default=None,
118-
help="HTTP server path (default: /mcp)",
85+
help="Specify the transport mode (stdio or sse)",
11986
)
12087

12188
parser.add_argument(
@@ -142,15 +109,6 @@ def load_from_args(config: AppConfig) -> AppConfig:
142109
if args.transport:
143110
config.server.transport = args.transport
144111

145-
if args.host:
146-
config.server.host = args.host
147-
148-
if args.port:
149-
config.server.port = args.port
150-
151-
if args.path:
152-
config.server.path = args.path
153-
154112
if args.chromedriver:
155113
config.chrome.chromedriver_path = args.chromedriver
156114

linkedin_mcp_server/config/schema.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,10 @@ class LinkedInConfig:
2626
class ServerConfig:
2727
"""MCP server configuration."""
2828

29-
transport: Literal["stdio", "streamable-http"] = "stdio"
29+
transport: Literal["stdio", "sse"] = "stdio"
3030
lazy_init: bool = True
3131
debug: bool = False
3232
setup: bool = True
33-
# HTTP transport configuration
34-
host: str = "127.0.0.1"
35-
port: int = 8000
36-
path: str = "/mcp"
3733

3834

3935
@dataclass

linkedin_mcp_server/config/secrets.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
# src/linkedin_mcp_server/config/secrets.py
2-
import logging
32
from typing import Dict, Optional
4-
3+
import logging
54
import inquirer # type: ignore
6-
75
from linkedin_mcp_server.config import get_config
8-
96
from .providers import (
107
get_credentials_from_keyring,
11-
get_keyring_name,
128
save_credentials_to_keyring,
9+
get_keyring_name,
1310
)
1411

1512
logger = logging.getLogger(__name__)

linkedin_mcp_server/drivers/chrome.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,17 @@
55
This module handles the creation and management of Chrome WebDriver instances.
66
"""
77

8-
import os
98
import sys
109
from typing import Dict, Optional
11-
12-
import inquirer # type: ignore
10+
import os
1311
from selenium import webdriver
14-
from selenium.common.exceptions import WebDriverException
1512
from selenium.webdriver.chrome.options import Options
1613
from selenium.webdriver.chrome.service import Service
17-
14+
from selenium.common.exceptions import WebDriverException
15+
import inquirer # type: ignore
1816
from linkedin_mcp_server.config import get_config
19-
from linkedin_mcp_server.config.providers import clear_credentials_from_keyring
2017
from linkedin_mcp_server.config.secrets import get_credentials
18+
from linkedin_mcp_server.config.providers import clear_credentials_from_keyring
2119

2220
# Global driver storage to reuse sessions
2321
active_drivers: Dict[str, webdriver.Chrome] = {}

linkedin_mcp_server/server.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
This module creates the MCP server and registers all the LinkedIn tools.
66
"""
77

8-
from typing import Any, Dict
9-
10-
from fastmcp import FastMCP
8+
from typing import Dict, Any
9+
from mcp.server.fastmcp import FastMCP
1110

1211
from linkedin_mcp_server.drivers.chrome import active_drivers
12+
from linkedin_mcp_server.tools.person import register_person_tools
1313
from linkedin_mcp_server.tools.company import register_company_tools
1414
from linkedin_mcp_server.tools.job import register_job_tools
15-
from linkedin_mcp_server.tools.person import register_person_tools
1615

1716

1817
def create_mcp_server() -> FastMCP:

linkedin_mcp_server/tools/company.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
This module provides tools for scraping LinkedIn company profiles.
66
"""
77

8-
from typing import Any, Dict, List
9-
10-
from fastmcp import FastMCP
8+
from typing import Dict, Any, List
9+
from mcp.server.fastmcp import FastMCP
1110
from linkedin_scraper import Company
1211

1312
from linkedin_mcp_server.drivers.chrome import get_or_create_driver

linkedin_mcp_server/tools/job.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
from typing import Any, Dict, List
99

10-
from fastmcp import FastMCP
1110
from linkedin_scraper import Job, JobSearch
11+
from mcp.server.fastmcp import FastMCP
1212

1313
from linkedin_mcp_server.drivers.chrome import get_or_create_driver
1414

linkedin_mcp_server/tools/person.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
This module provides tools for scraping LinkedIn person profiles.
66
"""
77

8-
from typing import Any, Dict, List
9-
10-
from fastmcp import FastMCP
8+
from typing import Dict, Any, List
9+
from mcp.server.fastmcp import FastMCP
1110
from linkedin_scraper import Person
1211

1312
from linkedin_mcp_server.drivers.chrome import get_or_create_driver

0 commit comments

Comments
 (0)