Skip to content
This repository was archived by the owner on Oct 27, 2025. It is now read-only.

Commit dad1363

Browse files
Merge pull request #1 from LinkupPlatform/feat/clean-for-launch
Remove resources and force standard/searchResults
2 parents 8f4eb4b + aca3f77 commit dad1363

File tree

4 files changed

+66
-39
lines changed

4 files changed

+66
-39
lines changed

pyproject.toml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
11
[project]
22
name = "mcp-search-linkup"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
description = "A MCP server to search web with Linkup"
55
readme = "README.md"
66
requires-python = ">=3.11"
77
dependencies = [
88
"linkup-sdk>=0.1.8",
99
"mcp>=1.0.0",
1010
]
11-
[[project.authors]]
12-
name = "Guillaume Larcher"
13-
1411

1512
[build-system]
1613
requires = [ "hatchling",]
1714
build-backend = "hatchling.build"
1815

1916
[project.scripts]
2017
mcp-search-linkup = "mcp_search_linkup:main"
18+
19+
[tool.ruff]
20+
line-length = 100
21+
target-version = "py38"
22+
23+
[tool.ruff.lint]
24+
select = [
25+
"E", # pycodestyle
26+
"F", # pyflakes
27+
"I", # isort
28+
"S", # flake8-bandit
29+
]
30+
31+
[dependency-groups]
32+
dev = [
33+
"ruff>=0.8.2",
34+
]

src/mcp_search_linkup/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
from . import server
22
import asyncio
33

4+
45
def main():
56
"""Main entry point for the package."""
67
asyncio.run(server.main())
78

9+
810
# Optionally expose other important items at package level
9-
__all__ = ['main', 'server']
11+
__all__ = ["main", "server"]

src/mcp_search_linkup/server.py

Lines changed: 11 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,32 @@
77
from pydantic import AnyUrl
88
import logging
99

10-
import os
11-
# Initialize the LinkupClient
12-
1310
server = Server("mcp-search-linkup")
1411
logger = logging.getLogger("mcp-search-linkup")
1512
logger.setLevel(logging.INFO)
1613

14+
1715
## Logging
1816
@server.set_logging_level()
1917
async def set_logging_level(level: types.LoggingLevel) -> types.EmptyResult:
2018
logger.setLevel(level.upper())
2119
await server.request_context.session.send_log_message(
22-
level="info",
23-
data=f"Log level set to {level}",
24-
logger="mcp-search-linkup"
20+
level="info", data=f"Log level set to {level}", logger="mcp-search-linkup"
2521
)
2622
return types.EmptyResult()
2723

24+
2825
## Resources
2926
@server.list_resources()
3027
async def list_resources() -> list[types.Resource]:
3128
return [
3229
types.Resource(
3330
uri=AnyUrl("https://www.thebridgechronicle.com/media"),
3431
name="The Bridge Chronicle",
35-
mimeType="text/html"
32+
mimeType="text/html",
3633
)
3734
]
3835

39-
@server.read_resource()
40-
async def read_resource(uri: AnyUrl) -> str:
41-
if str(uri) == "https://www.thebridgechronicle.com/media":
42-
page = client.content(url="https://www.thebridgechronicle.com/news/capgemini-employees-walk-together-in-celebration-of-indias-independence")
43-
return page.content
44-
45-
46-
raise ValueError("Resource not found")
4736

4837
## Tools
4938
@server.list_tools()
@@ -60,26 +49,15 @@ async def handle_list_tools() -> list[types.Tool]:
6049
"properties": {
6150
"query": {
6251
"type": "string",
63-
"description": "The query to search the web with. This should be a question, no need to write in keywords."
52+
"description": "The query to search the web with. This should be a question, no need to write in keywords.",
6453
},
65-
"depth": {
66-
"type": "string",
67-
"enum": ["standard", "deep"],
68-
"default": "standard",
69-
"description": "The depth of the search. Standard is a basic search while deep takes more time to complete but can answer more complex questions."
70-
},
71-
"output_type": {
72-
"type": "string",
73-
"enum": ["searchResults", "sourcedAnswer", "structured"],
74-
"default": "searchResults",
75-
"description": "The type of output to return"
76-
}
7754
},
7855
"required": ["query"],
7956
},
8057
)
8158
]
8259

60+
8361
@server.call_tool()
8462
async def handle_call_tool(
8563
name: str, arguments: dict | None
@@ -94,8 +72,6 @@ async def handle_call_tool(
9472
raise ValueError("Missing arguments")
9573

9674
query = arguments.get("query")
97-
depth = arguments.get("depth", "standard")
98-
output_type = arguments.get("output_type", "searchResults")
9975

10076
if not query:
10177
raise ValueError("Missing query")
@@ -104,8 +80,8 @@ async def handle_call_tool(
10480
# Perform the search using LinkupClient
10581
search_response = client.search(
10682
query=query,
107-
depth=depth,
108-
output_type=output_type,
83+
depth="standard",
84+
output_type="searchResults",
10985
)
11086

11187
return [
@@ -115,6 +91,7 @@ async def handle_call_tool(
11591
)
11692
]
11793

94+
11895
async def main():
11996
# Run the server using stdin/stdout streams
12097
async with mcp.server.stdio.stdio_server() as (read_stream, write_stream):
@@ -131,5 +108,6 @@ async def main():
131108
),
132109
)
133110

111+
134112
if __name__ == "__main__":
135-
asyncio.run(main())
113+
asyncio.run(main())

uv.lock

Lines changed: 34 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)