@perplexity-ai/mcp-server 0.13.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +49 -0
- package/LICENSE +21 -201
- package/README.md +105 -157
- package/dist/http.js +190 -0
- package/dist/index.js +23 -0
- package/dist/logger.js +82 -0
- package/dist/server.js +604 -0
- package/dist/types.js +1 -0
- package/dist/validation.js +62 -0
- package/package.json +56 -155
- package/compat.d.mts +0 -58
- package/compat.d.mts.map +0 -1
- package/compat.d.ts +0 -58
- package/compat.d.ts.map +0 -1
- package/compat.js +0 -387
- package/compat.js.map +0 -1
- package/compat.mjs +0 -378
- package/compat.mjs.map +0 -1
- package/dynamic-tools.d.mts +0 -12
- package/dynamic-tools.d.mts.map +0 -1
- package/dynamic-tools.d.ts +0 -12
- package/dynamic-tools.d.ts.map +0 -1
- package/dynamic-tools.js +0 -135
- package/dynamic-tools.js.map +0 -1
- package/dynamic-tools.mjs +0 -132
- package/dynamic-tools.mjs.map +0 -1
- package/filtering.d.mts +0 -2
- package/filtering.d.mts.map +0 -1
- package/filtering.d.ts +0 -2
- package/filtering.d.ts.map +0 -1
- package/filtering.js +0 -20
- package/filtering.js.map +0 -1
- package/filtering.mjs +0 -13
- package/filtering.mjs.map +0 -1
- package/headers.d.mts +0 -4
- package/headers.d.mts.map +0 -1
- package/headers.d.ts +0 -4
- package/headers.d.ts.map +0 -1
- package/headers.js +0 -22
- package/headers.js.map +0 -1
- package/headers.mjs +0 -18
- package/headers.mjs.map +0 -1
- package/http.d.mts +0 -9
- package/http.d.mts.map +0 -1
- package/http.d.ts +0 -9
- package/http.d.ts.map +0 -1
- package/http.js +0 -108
- package/http.js.map +0 -1
- package/http.mjs +0 -100
- package/http.mjs.map +0 -1
- package/index.d.mts +0 -3
- package/index.d.mts.map +0 -1
- package/index.d.ts +0 -3
- package/index.d.ts.map +0 -1
- package/index.js +0 -91
- package/index.js.map +0 -1
- package/index.mjs +0 -89
- package/index.mjs.map +0 -1
- package/options.d.mts +0 -18
- package/options.d.mts.map +0 -1
- package/options.d.ts +0 -18
- package/options.d.ts.map +0 -1
- package/options.js +0 -415
- package/options.js.map +0 -1
- package/options.mjs +0 -408
- package/options.mjs.map +0 -1
- package/server.d.mts +0 -35
- package/server.d.mts.map +0 -1
- package/server.d.ts +0 -35
- package/server.d.ts.map +0 -1
- package/server.js +0 -166
- package/server.js.map +0 -1
- package/server.mjs +0 -152
- package/server.mjs.map +0 -1
- package/src/compat.ts +0 -483
- package/src/dynamic-tools.ts +0 -159
- package/src/filtering.ts +0 -14
- package/src/headers.ts +0 -23
- package/src/http.ts +0 -127
- package/src/index.ts +0 -108
- package/src/options.ts +0 -453
- package/src/server.ts +0 -201
- package/src/stdio.ts +0 -13
- package/src/tools/chat/completions/create-chat-completions.ts +0 -1360
- package/src/tools/index.ts +0 -73
- package/src/tools/search/create-search.ts +0 -89
- package/src/tools/types.ts +0 -103
- package/src/tools.ts +0 -1
- package/src/tsconfig.json +0 -11
- package/stdio.d.mts +0 -3
- package/stdio.d.mts.map +0 -1
- package/stdio.d.ts +0 -3
- package/stdio.d.ts.map +0 -1
- package/stdio.js +0 -14
- package/stdio.js.map +0 -1
- package/stdio.mjs +0 -10
- package/stdio.mjs.map +0 -1
- package/tools/chat/completions/create-chat-completions.d.mts +0 -45
- package/tools/chat/completions/create-chat-completions.d.mts.map +0 -1
- package/tools/chat/completions/create-chat-completions.d.ts +0 -45
- package/tools/chat/completions/create-chat-completions.d.ts.map +0 -1
- package/tools/chat/completions/create-chat-completions.js +0 -1357
- package/tools/chat/completions/create-chat-completions.js.map +0 -1
- package/tools/chat/completions/create-chat-completions.mjs +0 -1353
- package/tools/chat/completions/create-chat-completions.mjs.map +0 -1
- package/tools/index.d.mts +0 -10
- package/tools/index.d.mts.map +0 -1
- package/tools/index.d.ts +0 -10
- package/tools/index.d.ts.map +0 -1
- package/tools/index.js +0 -57
- package/tools/index.js.map +0 -1
- package/tools/index.mjs +0 -50
- package/tools/index.mjs.map +0 -1
- package/tools/search/create-search.d.mts +0 -45
- package/tools/search/create-search.d.mts.map +0 -1
- package/tools/search/create-search.d.ts +0 -45
- package/tools/search/create-search.d.ts.map +0 -1
- package/tools/search/create-search.js +0 -86
- package/tools/search/create-search.js.map +0 -1
- package/tools/search/create-search.mjs +0 -82
- package/tools/search/create-search.mjs.map +0 -1
- package/tools/types.d.mts +0 -51
- package/tools/types.d.mts.map +0 -1
- package/tools/types.d.ts +0 -51
- package/tools/types.d.ts.map +0 -1
- package/tools/types.js +0 -46
- package/tools/types.js.map +0 -1
- package/tools/types.mjs +0 -42
- package/tools/types.mjs.map +0 -1
- package/tools.d.mts +0 -2
- package/tools.d.mts.map +0 -1
- package/tools.d.ts +0 -2
- package/tools.d.ts.map +0 -1
- package/tools.js +0 -18
- package/tools.js.map +0 -1
- package/tools.mjs +0 -2
- package/tools.mjs.map +0 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "perplexity-mcp-server",
|
|
3
|
+
"owner": {
|
|
4
|
+
"name": "Perplexity AI",
|
|
5
|
+
"email": "api@perplexity.ai"
|
|
6
|
+
},
|
|
7
|
+
"metadata": {
|
|
8
|
+
"description": "Official Perplexity AI plugin providing real-time web search, reasoning, and research capabilities",
|
|
9
|
+
"version": "1.0.0"
|
|
10
|
+
},
|
|
11
|
+
"plugins": [
|
|
12
|
+
{
|
|
13
|
+
"name": "perplexity",
|
|
14
|
+
"source": "./",
|
|
15
|
+
"description": "Real-time web search, reasoning, and research through Perplexity's API",
|
|
16
|
+
"version": "1.0.0",
|
|
17
|
+
"author": {
|
|
18
|
+
"name": "Perplexity AI",
|
|
19
|
+
"email": "api@perplexity.ai"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://docs.perplexity.ai/guides/mcp-server",
|
|
22
|
+
"repository": "https://github.com/perplexityai/modelcontextprotocol",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"keywords": [
|
|
25
|
+
"mcp",
|
|
26
|
+
"search",
|
|
27
|
+
"web-search",
|
|
28
|
+
"perplexity",
|
|
29
|
+
"research",
|
|
30
|
+
"reasoning",
|
|
31
|
+
"ai"
|
|
32
|
+
],
|
|
33
|
+
"category": "productivity",
|
|
34
|
+
"strict": false,
|
|
35
|
+
"mcpServers": {
|
|
36
|
+
"perplexity": {
|
|
37
|
+
"type": "stdio",
|
|
38
|
+
"command": "npx",
|
|
39
|
+
"args": ["-y", "@perplexity-ai/mcp-server"],
|
|
40
|
+
"env": {
|
|
41
|
+
"PERPLEXITY_API_KEY": "${PERPLEXITY_API_KEY}",
|
|
42
|
+
"PERPLEXITY_TIMEOUT_MS": "${PERPLEXITY_TIMEOUT_MS:-600000}"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
|
package/LICENSE
CHANGED
|
@@ -1,201 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright 2025 Perplexity
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 perplexity
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,213 +1,161 @@
|
|
|
1
|
-
# Perplexity
|
|
1
|
+
# Perplexity API Platform MCP Server
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://cursor.com/en/install-mcp?name=perplexity&config=eyJ0eXBlIjoic3RkaW8iLCJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkBwZXJwbGV4aXR5LWFpL21jcC1zZXJ2ZXIiXSwiZW52Ijp7IlBFUlBMRVhJVFlfQVBJX0tFWSI6IiJ9fQ==)
|
|
4
|
+
|
|
5
|
+
[](https://vscode.dev/redirect/mcp/install?name=perplexity&config=%7B%22type%22%3A%22stdio%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40perplexity-ai%2Fmcp-server%22%5D%2C%22env%22%3A%7B%22PERPLEXITY_API_KEY%22%3A%22%22%7D%7D)
|
|
6
|
+
|
|
7
|
+
[](https://kiro.dev/launch/mcp/add?name=perplexity&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40perplexity-ai%2Fmcp-server%22%5D%2C%22env%22%3A%7B%22PERPLEXITY_API_KEY%22%3A%22your_key_here%22%7D%7D)
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/@perplexity-ai/mcp-server)
|
|
4
10
|
|
|
5
|
-
|
|
11
|
+
The official MCP server implementation for the Perplexity API Platform, providing AI assistants with real-time web search, reasoning, and research capabilities through the [Agent API](https://docs.perplexity.ai/docs/agent-api/quickstart) and the Search API.
|
|
6
12
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
You can run the MCP Server directly via `npx`:
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
export PERPLEXITY_API_KEY="My API Key"
|
|
13
|
-
npx -y @perplexity-ai/mcp-server@latest
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
### Via MCP Client
|
|
17
|
-
|
|
18
|
-
There is a partial list of existing clients at [modelcontextprotocol.io](https://modelcontextprotocol.io/clients). If you already
|
|
19
|
-
have a client, consult their documentation to install the MCP server.
|
|
20
|
-
|
|
21
|
-
For clients with a configuration JSON, it might look something like this:
|
|
22
|
-
|
|
23
|
-
```json
|
|
24
|
-
{
|
|
25
|
-
"mcpServers": {
|
|
26
|
-
"perplexity_ai_perplexity_ai_api": {
|
|
27
|
-
"command": "npx",
|
|
28
|
-
"args": ["-y", "@perplexity-ai/mcp-server", "--client=claude", "--tools=all"],
|
|
29
|
-
"env": {
|
|
30
|
-
"PERPLEXITY_API_KEY": "My API Key"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Exposing endpoints to your MCP Client
|
|
38
|
-
|
|
39
|
-
There are two ways to expose endpoints as tools in the MCP server:
|
|
40
|
-
|
|
41
|
-
1. Exposing one tool per endpoint, and filtering as necessary
|
|
42
|
-
2. Exposing a set of tools to dynamically discover and invoke endpoints from the API
|
|
43
|
-
|
|
44
|
-
### Filtering endpoints and tools
|
|
45
|
-
|
|
46
|
-
You can run the package on the command line to discover and filter the set of tools that are exposed by the
|
|
47
|
-
MCP Server. This can be helpful for large APIs where including all endpoints at once is too much for your AI's
|
|
48
|
-
context window.
|
|
49
|
-
|
|
50
|
-
You can filter by multiple aspects:
|
|
51
|
-
|
|
52
|
-
- `--tool` includes a specific tool by name
|
|
53
|
-
- `--resource` includes all tools under a specific resource, and can have wildcards, e.g. `my.resource*`
|
|
54
|
-
- `--operation` includes just read (get/list) or just write operations
|
|
55
|
-
|
|
56
|
-
### Dynamic tools
|
|
57
|
-
|
|
58
|
-
If you specify `--tools=dynamic` to the MCP server, instead of exposing one tool per endpoint in the API, it will
|
|
59
|
-
expose the following tools:
|
|
60
|
-
|
|
61
|
-
1. `list_api_endpoints` - Discovers available endpoints, with optional filtering by search query
|
|
62
|
-
2. `get_api_endpoint_schema` - Gets detailed schema information for a specific endpoint
|
|
63
|
-
3. `invoke_api_endpoint` - Executes any endpoint with the appropriate parameters
|
|
64
|
-
|
|
65
|
-
This allows you to have the full set of API endpoints available to your MCP Client, while not requiring that all
|
|
66
|
-
of their schemas be loaded into context at once. Instead, the LLM will automatically use these tools together to
|
|
67
|
-
search for, look up, and invoke endpoints dynamically. However, due to the indirect nature of the schemas, it
|
|
68
|
-
can struggle to provide the correct properties a bit more than when tools are imported explicitly. Therefore,
|
|
69
|
-
you can opt-in to explicit tools, the dynamic tools, or both.
|
|
70
|
-
|
|
71
|
-
See more information with `--help`.
|
|
72
|
-
|
|
73
|
-
All of these command-line options can be repeated, combined together, and have corresponding exclusion versions (e.g. `--no-tool`).
|
|
74
|
-
|
|
75
|
-
Use `--list` to see the list of available tools, or see below.
|
|
76
|
-
|
|
77
|
-
### Specifying the MCP Client
|
|
78
|
-
|
|
79
|
-
Different clients have varying abilities to handle arbitrary tools and schemas.
|
|
13
|
+
## Available Tools
|
|
80
14
|
|
|
81
|
-
|
|
82
|
-
|
|
15
|
+
### **perplexity_search**
|
|
16
|
+
Direct web search using the Perplexity Search API. Returns ranked search results with metadata, perfect for finding current information.
|
|
83
17
|
|
|
84
|
-
|
|
18
|
+
### **perplexity_ask**
|
|
19
|
+
General-purpose conversational AI with real-time web search, backed by the Agent API `fast` preset. Great for quick questions and everyday searches.
|
|
85
20
|
|
|
86
|
-
|
|
87
|
-
|
|
21
|
+
### **perplexity_research**
|
|
22
|
+
Deep, comprehensive research backed by the Agent API `high` preset. Ideal for thorough analysis and detailed reports. Runs can take minutes; the server streams the run and reports progress to clients that request it.
|
|
88
23
|
|
|
89
|
-
|
|
90
|
-
|
|
24
|
+
### **perplexity_reason**
|
|
25
|
+
Advanced reasoning and problem-solving backed by the Agent API `medium` preset. Perfect for complex analytical tasks.
|
|
91
26
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
- `top-level-unions`: Enable support for top-level unions in tool schemas
|
|
95
|
-
- `valid-json`: Enable JSON string parsing for arguments
|
|
96
|
-
- `refs`: Enable support for $ref pointers in schemas
|
|
97
|
-
- `unions`: Enable support for union types (anyOf) in schemas
|
|
98
|
-
- `formats`: Enable support for format validations in schemas (e.g. date-time, email)
|
|
99
|
-
- `tool-name-length=N`: Set maximum tool name length to N characters
|
|
100
|
-
- Example: `--capability=top-level-unions --capability=tool-name-length=40`
|
|
101
|
-
- Example: `--capability=top-level-unions,tool-name-length=40`
|
|
27
|
+
> [!NOTE]
|
|
28
|
+
> Presets are managed configurations (model, search setup, step budget) that Perplexity keeps tuned over time; see the [presets guide](https://docs.perplexity.ai/docs/agent-api/presets). Earlier versions of this server called the legacy `sonar-pro`, `sonar-reasoning-pro`, and `sonar-deep-research` models and accepted `strip_thinking` / `reasoning_effort` parameters. Those parameters are no longer part of the tool schemas and are ignored if sent; the Agent API produces no `<think>` tags.
|
|
102
29
|
|
|
103
|
-
|
|
30
|
+
## Configuration
|
|
104
31
|
|
|
105
|
-
|
|
32
|
+
### Get Your API Key
|
|
106
33
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
34
|
+
1. Get your Perplexity API Key from the [API Portal](https://www.perplexity.ai/account/api/group)
|
|
35
|
+
2. Replace `your_key_here` in the configurations below with your API key
|
|
36
|
+
3. (Optional) Set timeout: `PERPLEXITY_TIMEOUT_MS=600000` (default: 5 minutes)
|
|
37
|
+
4. (Optional) Set custom base URL: `PERPLEXITY_BASE_URL=https://your-custom-url.com` (default: https://api.perplexity.ai)
|
|
38
|
+
5. (Optional) Set log level: `PERPLEXITY_LOG_LEVEL=DEBUG|INFO|WARN|ERROR` (default: ERROR)
|
|
110
39
|
|
|
111
|
-
|
|
40
|
+
### Claude Code
|
|
112
41
|
|
|
113
42
|
```bash
|
|
114
|
-
--
|
|
43
|
+
claude mcp add perplexity --env PERPLEXITY_API_KEY="your_key_here" -- npx -y @perplexity-ai/mcp-server
|
|
115
44
|
```
|
|
116
45
|
|
|
117
|
-
|
|
118
|
-
|
|
46
|
+
Or install via plugin:
|
|
119
47
|
```bash
|
|
120
|
-
|
|
48
|
+
export PERPLEXITY_API_KEY="your_key_here"
|
|
49
|
+
claude
|
|
50
|
+
# Then run: /plugin marketplace add perplexityai/modelcontextprotocol
|
|
51
|
+
# Then run: /plugin install perplexity
|
|
121
52
|
```
|
|
122
53
|
|
|
123
|
-
|
|
54
|
+
### Codex
|
|
124
55
|
|
|
125
56
|
```bash
|
|
126
|
-
--
|
|
57
|
+
codex mcp add perplexity --env PERPLEXITY_API_KEY="your_key_here" -- npx -y @perplexity-ai/mcp-server
|
|
127
58
|
```
|
|
128
59
|
|
|
129
|
-
|
|
60
|
+
### Cursor, Claude Desktop, Kiro, Windsurf, and VS Code
|
|
130
61
|
|
|
131
|
-
|
|
62
|
+
Most clients can be configured manually using the same `mcpServers` wrapper in their client config (as shown for Cursor). If a client has a different schema, check its docs for the exact wrapper format.
|
|
132
63
|
|
|
133
|
-
|
|
64
|
+
For manual setup, these clients all use the same `mcpServers` structure:
|
|
134
65
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
|
138
|
-
|
|
|
139
|
-
|
|
140
|
-
|
|
66
|
+
| Client | Config File |
|
|
67
|
+
|--------|-------------|
|
|
68
|
+
| Cursor | `~/.cursor/mcp.json` |
|
|
69
|
+
| Claude Desktop | `claude_desktop_config.json` |
|
|
70
|
+
| Kiro | `.kiro/settings/mcp.json` |
|
|
71
|
+
| Windsurf | `~/.codeium/windsurf/mcp_config.json` |
|
|
72
|
+
| VS Code | `.vscode/mcp.json` |
|
|
141
73
|
|
|
142
74
|
```json
|
|
143
75
|
{
|
|
144
76
|
"mcpServers": {
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
|
|
77
|
+
"perplexity": {
|
|
78
|
+
"command": "npx",
|
|
79
|
+
"args": ["-y", "@perplexity-ai/mcp-server"],
|
|
80
|
+
"env": {
|
|
81
|
+
"PERPLEXITY_API_KEY": "your_key_here"
|
|
149
82
|
}
|
|
150
83
|
}
|
|
151
84
|
}
|
|
152
85
|
}
|
|
153
86
|
```
|
|
154
87
|
|
|
155
|
-
|
|
156
|
-
For example, to exclude specific tools while including others, use the URL:
|
|
88
|
+
### Proxy Setup (For Corporate Networks)
|
|
157
89
|
|
|
158
|
-
|
|
159
|
-
http://localhost:3000?resource=cards&resource=accounts&no_tool=create_cards
|
|
160
|
-
```
|
|
90
|
+
If you are running this server at work—especially behind a company firewall or proxy—you may need to tell the program how to send its internet traffic through your network's proxy. Follow these steps:
|
|
161
91
|
|
|
162
|
-
|
|
92
|
+
**1. Get your proxy details**
|
|
163
93
|
|
|
94
|
+
- Ask your IT department for your HTTPS proxy address and port.
|
|
95
|
+
- You may also need a username and password.
|
|
96
|
+
|
|
97
|
+
**2. Set the proxy environment variable**
|
|
98
|
+
|
|
99
|
+
The easiest and most reliable way for Perplexity MCP is to use `PERPLEXITY_PROXY`. For example:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
export PERPLEXITY_PROXY=https://your-proxy-host:8080
|
|
164
103
|
```
|
|
165
|
-
|
|
104
|
+
|
|
105
|
+
If your proxy needs a username and password, use:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
export PERPLEXITY_PROXY=https://username:password@your-proxy-host:8080
|
|
166
109
|
```
|
|
167
110
|
|
|
168
|
-
|
|
111
|
+
**3. Alternate: Standard environment variables**
|
|
169
112
|
|
|
170
|
-
|
|
171
|
-
// Import the server, generated endpoints, or the init function
|
|
172
|
-
import { server, endpoints, init } from "@perplexity-ai/mcp-server/server";
|
|
113
|
+
If you'd rather use the standard variables, we support `HTTPS_PROXY` and `HTTP_PROXY`.
|
|
173
114
|
|
|
174
|
-
|
|
175
|
-
|
|
115
|
+
> [!NOTE]
|
|
116
|
+
> The server checks proxy settings in this order: `PERPLEXITY_PROXY` → `HTTPS_PROXY` → `HTTP_PROXY`. If none are set, it connects directly to the internet.
|
|
117
|
+
> URLs must include `https://`. Typical ports are `8080`, `3128`, and `80`.
|
|
176
118
|
|
|
177
|
-
|
|
178
|
-
init({ server, endpoints });
|
|
119
|
+
### HTTP Server Deployment
|
|
179
120
|
|
|
180
|
-
|
|
181
|
-
const transport = new StdioServerTransport();
|
|
182
|
-
await server.connect(transport);
|
|
121
|
+
For cloud or shared deployments, run the server in HTTP mode.
|
|
183
122
|
|
|
184
|
-
|
|
185
|
-
const myServer = new McpServer(...);
|
|
123
|
+
#### Environment Variables
|
|
186
124
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
return { myResponse: 'Hello world!' };
|
|
196
|
-
})
|
|
197
|
-
};
|
|
125
|
+
| Variable | Description | Default |
|
|
126
|
+
|----------|-------------|---------|
|
|
127
|
+
| `PERPLEXITY_API_KEY` | Your Perplexity API key | *Required* |
|
|
128
|
+
| `PERPLEXITY_BASE_URL` | Custom base URL for API requests | `https://api.perplexity.ai` |
|
|
129
|
+
| `PORT` | HTTP server port | `8080` |
|
|
130
|
+
| `BIND_ADDRESS` | Network interface to bind to. Defaults to loopback. Set to `0.0.0.0` to expose on all interfaces. | `127.0.0.1` |
|
|
131
|
+
| `ALLOWED_ORIGINS` | CORS origins (comma-separated). Defaults to empty (no cross-origin browser requests). Set to an explicit allowlist (e.g. `https://app.example.com`) or to `*` to allow any origin. | *(empty)* |
|
|
132
|
+
| `ALLOWED_HOSTS` | Additional `Host` header values to accept (comma-separated). Loopback hosts on `PORT` are always allowed. Add the public hostname when binding to `0.0.0.0`. | *(loopback only)* |
|
|
198
133
|
|
|
199
|
-
|
|
200
|
-
|
|
134
|
+
#### Docker
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
docker build -t perplexity-mcp-server .
|
|
138
|
+
docker run -p 8080:8080 -e PERPLEXITY_API_KEY=your_key_here perplexity-mcp-server
|
|
201
139
|
```
|
|
202
140
|
|
|
203
|
-
|
|
141
|
+
#### Node.js
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
export PERPLEXITY_API_KEY=your_key_here
|
|
145
|
+
npm install && npm run build && npm run start:http
|
|
146
|
+
```
|
|
204
147
|
|
|
205
|
-
The
|
|
148
|
+
The server will be accessible at `http://localhost:8080/mcp`
|
|
206
149
|
|
|
207
|
-
|
|
150
|
+
## Troubleshooting
|
|
208
151
|
|
|
209
|
-
-
|
|
152
|
+
- **API Key Issues**: Ensure `PERPLEXITY_API_KEY` is set correctly
|
|
153
|
+
- **Connection Errors**: Check your internet connection and API key validity
|
|
154
|
+
- **Tool Not Found**: Make sure the package is installed and the command path is correct
|
|
155
|
+
- **Timeout Errors**: For very long research queries, set `PERPLEXITY_TIMEOUT_MS` to a higher value
|
|
156
|
+
- **Proxy Issues**: Verify your `PERPLEXITY_PROXY` or `HTTPS_PROXY` setup and ensure `api.perplexity.ai` isn't blocked by your firewall.
|
|
157
|
+
- **EOF / Initialize Errors**: Some strict MCP clients fail because `npx` writes installation messages to stdout. Use `npx -yq` instead of `npx -y` to suppress this output.
|
|
210
158
|
|
|
211
|
-
|
|
159
|
+
For support, visit [community.perplexity.ai](https://community.perplexity.ai) or [file an issue](https://github.com/perplexityai/modelcontextprotocol/issues).
|
|
212
160
|
|
|
213
|
-
|
|
161
|
+
---
|