universal-mcp-applications 0.1.1__py3-none-any.whl

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.
Files changed (268) hide show
  1. universal_mcp/applications/ahrefs/README.md +51 -0
  2. universal_mcp/applications/ahrefs/__init__.py +1 -0
  3. universal_mcp/applications/ahrefs/app.py +2291 -0
  4. universal_mcp/applications/airtable/README.md +22 -0
  5. universal_mcp/applications/airtable/__init__.py +1 -0
  6. universal_mcp/applications/airtable/app.py +479 -0
  7. universal_mcp/applications/apollo/README.md +44 -0
  8. universal_mcp/applications/apollo/__init__.py +1 -0
  9. universal_mcp/applications/apollo/app.py +1847 -0
  10. universal_mcp/applications/asana/README.md +199 -0
  11. universal_mcp/applications/asana/__init__.py +1 -0
  12. universal_mcp/applications/asana/app.py +9509 -0
  13. universal_mcp/applications/aws-s3/README.md +0 -0
  14. universal_mcp/applications/aws-s3/__init__.py +1 -0
  15. universal_mcp/applications/aws-s3/app.py +552 -0
  16. universal_mcp/applications/bill/README.md +0 -0
  17. universal_mcp/applications/bill/__init__.py +1 -0
  18. universal_mcp/applications/bill/app.py +8705 -0
  19. universal_mcp/applications/box/README.md +307 -0
  20. universal_mcp/applications/box/__init__.py +1 -0
  21. universal_mcp/applications/box/app.py +15987 -0
  22. universal_mcp/applications/braze/README.md +106 -0
  23. universal_mcp/applications/braze/__init__.py +1 -0
  24. universal_mcp/applications/braze/app.py +4754 -0
  25. universal_mcp/applications/cal-com-v2/README.md +150 -0
  26. universal_mcp/applications/cal-com-v2/__init__.py +1 -0
  27. universal_mcp/applications/cal-com-v2/app.py +5541 -0
  28. universal_mcp/applications/calendly/README.md +53 -0
  29. universal_mcp/applications/calendly/__init__.py +1 -0
  30. universal_mcp/applications/calendly/app.py +1436 -0
  31. universal_mcp/applications/canva/README.md +43 -0
  32. universal_mcp/applications/canva/__init__.py +1 -0
  33. universal_mcp/applications/canva/app.py +941 -0
  34. universal_mcp/applications/clickup/README.md +135 -0
  35. universal_mcp/applications/clickup/__init__.py +1 -0
  36. universal_mcp/applications/clickup/app.py +5009 -0
  37. universal_mcp/applications/coda/README.md +108 -0
  38. universal_mcp/applications/coda/__init__.py +1 -0
  39. universal_mcp/applications/coda/app.py +3671 -0
  40. universal_mcp/applications/confluence/README.md +198 -0
  41. universal_mcp/applications/confluence/__init__.py +1 -0
  42. universal_mcp/applications/confluence/app.py +6273 -0
  43. universal_mcp/applications/contentful/README.md +17 -0
  44. universal_mcp/applications/contentful/__init__.py +1 -0
  45. universal_mcp/applications/contentful/app.py +364 -0
  46. universal_mcp/applications/crustdata/README.md +25 -0
  47. universal_mcp/applications/crustdata/__init__.py +1 -0
  48. universal_mcp/applications/crustdata/app.py +586 -0
  49. universal_mcp/applications/dialpad/README.md +202 -0
  50. universal_mcp/applications/dialpad/__init__.py +1 -0
  51. universal_mcp/applications/dialpad/app.py +5949 -0
  52. universal_mcp/applications/digitalocean/README.md +463 -0
  53. universal_mcp/applications/digitalocean/__init__.py +1 -0
  54. universal_mcp/applications/digitalocean/app.py +20835 -0
  55. universal_mcp/applications/domain-checker/README.md +13 -0
  56. universal_mcp/applications/domain-checker/__init__.py +1 -0
  57. universal_mcp/applications/domain-checker/app.py +265 -0
  58. universal_mcp/applications/e2b/README.md +12 -0
  59. universal_mcp/applications/e2b/__init__.py +1 -0
  60. universal_mcp/applications/e2b/app.py +187 -0
  61. universal_mcp/applications/elevenlabs/README.md +88 -0
  62. universal_mcp/applications/elevenlabs/__init__.py +1 -0
  63. universal_mcp/applications/elevenlabs/app.py +3235 -0
  64. universal_mcp/applications/exa/README.md +15 -0
  65. universal_mcp/applications/exa/__init__.py +1 -0
  66. universal_mcp/applications/exa/app.py +221 -0
  67. universal_mcp/applications/falai/README.md +17 -0
  68. universal_mcp/applications/falai/__init__.py +1 -0
  69. universal_mcp/applications/falai/app.py +331 -0
  70. universal_mcp/applications/figma/README.md +49 -0
  71. universal_mcp/applications/figma/__init__.py +1 -0
  72. universal_mcp/applications/figma/app.py +1090 -0
  73. universal_mcp/applications/firecrawl/README.md +20 -0
  74. universal_mcp/applications/firecrawl/__init__.py +1 -0
  75. universal_mcp/applications/firecrawl/app.py +514 -0
  76. universal_mcp/applications/fireflies/README.md +25 -0
  77. universal_mcp/applications/fireflies/__init__.py +1 -0
  78. universal_mcp/applications/fireflies/app.py +506 -0
  79. universal_mcp/applications/fpl/README.md +23 -0
  80. universal_mcp/applications/fpl/__init__.py +1 -0
  81. universal_mcp/applications/fpl/app.py +1327 -0
  82. universal_mcp/applications/fpl/utils/api.py +142 -0
  83. universal_mcp/applications/fpl/utils/fixtures.py +629 -0
  84. universal_mcp/applications/fpl/utils/helper.py +982 -0
  85. universal_mcp/applications/fpl/utils/league_utils.py +546 -0
  86. universal_mcp/applications/fpl/utils/position_utils.py +68 -0
  87. universal_mcp/applications/ghost-content/README.md +25 -0
  88. universal_mcp/applications/ghost-content/__init__.py +1 -0
  89. universal_mcp/applications/ghost-content/app.py +654 -0
  90. universal_mcp/applications/github/README.md +1049 -0
  91. universal_mcp/applications/github/__init__.py +1 -0
  92. universal_mcp/applications/github/app.py +50600 -0
  93. universal_mcp/applications/gong/README.md +63 -0
  94. universal_mcp/applications/gong/__init__.py +1 -0
  95. universal_mcp/applications/gong/app.py +2297 -0
  96. universal_mcp/applications/google-ads/README.md +0 -0
  97. universal_mcp/applications/google-ads/__init__.py +1 -0
  98. universal_mcp/applications/google-ads/app.py +23 -0
  99. universal_mcp/applications/google-calendar/README.md +21 -0
  100. universal_mcp/applications/google-calendar/__init__.py +1 -0
  101. universal_mcp/applications/google-calendar/app.py +574 -0
  102. universal_mcp/applications/google-docs/README.md +25 -0
  103. universal_mcp/applications/google-docs/__init__.py +1 -0
  104. universal_mcp/applications/google-docs/app.py +760 -0
  105. universal_mcp/applications/google-drive/README.md +68 -0
  106. universal_mcp/applications/google-drive/__init__.py +1 -0
  107. universal_mcp/applications/google-drive/app.py +4936 -0
  108. universal_mcp/applications/google-gemini/README.md +25 -0
  109. universal_mcp/applications/google-gemini/__init__.py +1 -0
  110. universal_mcp/applications/google-gemini/app.py +663 -0
  111. universal_mcp/applications/google-mail/README.md +31 -0
  112. universal_mcp/applications/google-mail/__init__.py +1 -0
  113. universal_mcp/applications/google-mail/app.py +1354 -0
  114. universal_mcp/applications/google-searchconsole/README.md +21 -0
  115. universal_mcp/applications/google-searchconsole/__init__.py +1 -0
  116. universal_mcp/applications/google-searchconsole/app.py +320 -0
  117. universal_mcp/applications/google-sheet/README.md +36 -0
  118. universal_mcp/applications/google-sheet/__init__.py +1 -0
  119. universal_mcp/applications/google-sheet/app.py +1941 -0
  120. universal_mcp/applications/hashnode/README.md +20 -0
  121. universal_mcp/applications/hashnode/__init__.py +1 -0
  122. universal_mcp/applications/hashnode/app.py +455 -0
  123. universal_mcp/applications/heygen/README.md +44 -0
  124. universal_mcp/applications/heygen/__init__.py +1 -0
  125. universal_mcp/applications/heygen/app.py +961 -0
  126. universal_mcp/applications/http-tools/README.md +16 -0
  127. universal_mcp/applications/http-tools/__init__.py +1 -0
  128. universal_mcp/applications/http-tools/app.py +153 -0
  129. universal_mcp/applications/hubspot/README.md +239 -0
  130. universal_mcp/applications/hubspot/__init__.py +1 -0
  131. universal_mcp/applications/hubspot/app.py +416 -0
  132. universal_mcp/applications/jira/README.md +600 -0
  133. universal_mcp/applications/jira/__init__.py +1 -0
  134. universal_mcp/applications/jira/app.py +28804 -0
  135. universal_mcp/applications/klaviyo/README.md +313 -0
  136. universal_mcp/applications/klaviyo/__init__.py +1 -0
  137. universal_mcp/applications/klaviyo/app.py +11236 -0
  138. universal_mcp/applications/linkedin/README.md +15 -0
  139. universal_mcp/applications/linkedin/__init__.py +1 -0
  140. universal_mcp/applications/linkedin/app.py +243 -0
  141. universal_mcp/applications/mailchimp/README.md +281 -0
  142. universal_mcp/applications/mailchimp/__init__.py +1 -0
  143. universal_mcp/applications/mailchimp/app.py +10937 -0
  144. universal_mcp/applications/markitdown/README.md +12 -0
  145. universal_mcp/applications/markitdown/__init__.py +1 -0
  146. universal_mcp/applications/markitdown/app.py +63 -0
  147. universal_mcp/applications/miro/README.md +151 -0
  148. universal_mcp/applications/miro/__init__.py +1 -0
  149. universal_mcp/applications/miro/app.py +5429 -0
  150. universal_mcp/applications/ms-teams/README.md +42 -0
  151. universal_mcp/applications/ms-teams/__init__.py +1 -0
  152. universal_mcp/applications/ms-teams/app.py +1823 -0
  153. universal_mcp/applications/neon/README.md +74 -0
  154. universal_mcp/applications/neon/__init__.py +1 -0
  155. universal_mcp/applications/neon/app.py +2018 -0
  156. universal_mcp/applications/notion/README.md +30 -0
  157. universal_mcp/applications/notion/__init__.py +1 -0
  158. universal_mcp/applications/notion/app.py +527 -0
  159. universal_mcp/applications/openai/README.md +22 -0
  160. universal_mcp/applications/openai/__init__.py +1 -0
  161. universal_mcp/applications/openai/app.py +759 -0
  162. universal_mcp/applications/outlook/README.md +20 -0
  163. universal_mcp/applications/outlook/__init__.py +1 -0
  164. universal_mcp/applications/outlook/app.py +444 -0
  165. universal_mcp/applications/perplexity/README.md +12 -0
  166. universal_mcp/applications/perplexity/__init__.py +1 -0
  167. universal_mcp/applications/perplexity/app.py +65 -0
  168. universal_mcp/applications/pipedrive/README.md +284 -0
  169. universal_mcp/applications/pipedrive/__init__.py +1 -0
  170. universal_mcp/applications/pipedrive/app.py +12924 -0
  171. universal_mcp/applications/posthog/README.md +132 -0
  172. universal_mcp/applications/posthog/__init__.py +1 -0
  173. universal_mcp/applications/posthog/app.py +7125 -0
  174. universal_mcp/applications/reddit/README.md +135 -0
  175. universal_mcp/applications/reddit/__init__.py +1 -0
  176. universal_mcp/applications/reddit/app.py +4652 -0
  177. universal_mcp/applications/replicate/README.md +18 -0
  178. universal_mcp/applications/replicate/__init__.py +1 -0
  179. universal_mcp/applications/replicate/app.py +495 -0
  180. universal_mcp/applications/resend/README.md +40 -0
  181. universal_mcp/applications/resend/__init__.py +1 -0
  182. universal_mcp/applications/resend/app.py +881 -0
  183. universal_mcp/applications/retell/README.md +21 -0
  184. universal_mcp/applications/retell/__init__.py +1 -0
  185. universal_mcp/applications/retell/app.py +333 -0
  186. universal_mcp/applications/rocketlane/README.md +70 -0
  187. universal_mcp/applications/rocketlane/__init__.py +1 -0
  188. universal_mcp/applications/rocketlane/app.py +4346 -0
  189. universal_mcp/applications/semanticscholar/README.md +25 -0
  190. universal_mcp/applications/semanticscholar/__init__.py +1 -0
  191. universal_mcp/applications/semanticscholar/app.py +482 -0
  192. universal_mcp/applications/semrush/README.md +44 -0
  193. universal_mcp/applications/semrush/__init__.py +1 -0
  194. universal_mcp/applications/semrush/app.py +2081 -0
  195. universal_mcp/applications/sendgrid/README.md +362 -0
  196. universal_mcp/applications/sendgrid/__init__.py +1 -0
  197. universal_mcp/applications/sendgrid/app.py +9752 -0
  198. universal_mcp/applications/sentry/README.md +186 -0
  199. universal_mcp/applications/sentry/__init__.py +1 -0
  200. universal_mcp/applications/sentry/app.py +7471 -0
  201. universal_mcp/applications/serpapi/README.md +14 -0
  202. universal_mcp/applications/serpapi/__init__.py +1 -0
  203. universal_mcp/applications/serpapi/app.py +293 -0
  204. universal_mcp/applications/sharepoint/README.md +0 -0
  205. universal_mcp/applications/sharepoint/__init__.py +1 -0
  206. universal_mcp/applications/sharepoint/app.py +215 -0
  207. universal_mcp/applications/shopify/README.md +321 -0
  208. universal_mcp/applications/shopify/__init__.py +1 -0
  209. universal_mcp/applications/shopify/app.py +15392 -0
  210. universal_mcp/applications/shortcut/README.md +128 -0
  211. universal_mcp/applications/shortcut/__init__.py +1 -0
  212. universal_mcp/applications/shortcut/app.py +4478 -0
  213. universal_mcp/applications/slack/README.md +0 -0
  214. universal_mcp/applications/slack/__init__.py +1 -0
  215. universal_mcp/applications/slack/app.py +570 -0
  216. universal_mcp/applications/spotify/README.md +91 -0
  217. universal_mcp/applications/spotify/__init__.py +1 -0
  218. universal_mcp/applications/spotify/app.py +2526 -0
  219. universal_mcp/applications/supabase/README.md +87 -0
  220. universal_mcp/applications/supabase/__init__.py +1 -0
  221. universal_mcp/applications/supabase/app.py +2970 -0
  222. universal_mcp/applications/tavily/README.md +12 -0
  223. universal_mcp/applications/tavily/__init__.py +1 -0
  224. universal_mcp/applications/tavily/app.py +51 -0
  225. universal_mcp/applications/trello/README.md +266 -0
  226. universal_mcp/applications/trello/__init__.py +1 -0
  227. universal_mcp/applications/trello/app.py +10875 -0
  228. universal_mcp/applications/twillo/README.md +0 -0
  229. universal_mcp/applications/twillo/__init__.py +1 -0
  230. universal_mcp/applications/twillo/app.py +269 -0
  231. universal_mcp/applications/twitter/README.md +100 -0
  232. universal_mcp/applications/twitter/__init__.py +1 -0
  233. universal_mcp/applications/twitter/api_segments/__init__.py +0 -0
  234. universal_mcp/applications/twitter/api_segments/api_segment_base.py +51 -0
  235. universal_mcp/applications/twitter/api_segments/compliance_api.py +122 -0
  236. universal_mcp/applications/twitter/api_segments/dm_conversations_api.py +255 -0
  237. universal_mcp/applications/twitter/api_segments/dm_events_api.py +140 -0
  238. universal_mcp/applications/twitter/api_segments/likes_api.py +159 -0
  239. universal_mcp/applications/twitter/api_segments/lists_api.py +395 -0
  240. universal_mcp/applications/twitter/api_segments/openapi_json_api.py +34 -0
  241. universal_mcp/applications/twitter/api_segments/spaces_api.py +309 -0
  242. universal_mcp/applications/twitter/api_segments/trends_api.py +40 -0
  243. universal_mcp/applications/twitter/api_segments/tweets_api.py +1403 -0
  244. universal_mcp/applications/twitter/api_segments/usage_api.py +40 -0
  245. universal_mcp/applications/twitter/api_segments/users_api.py +1498 -0
  246. universal_mcp/applications/twitter/app.py +46 -0
  247. universal_mcp/applications/unipile/README.md +28 -0
  248. universal_mcp/applications/unipile/__init__.py +1 -0
  249. universal_mcp/applications/unipile/app.py +829 -0
  250. universal_mcp/applications/whatsapp/README.md +23 -0
  251. universal_mcp/applications/whatsapp/__init__.py +1 -0
  252. universal_mcp/applications/whatsapp/app.py +595 -0
  253. universal_mcp/applications/whatsapp-business/README.md +34 -0
  254. universal_mcp/applications/whatsapp-business/__init__.py +1 -0
  255. universal_mcp/applications/whatsapp-business/app.py +1065 -0
  256. universal_mcp/applications/wrike/README.md +46 -0
  257. universal_mcp/applications/wrike/__init__.py +1 -0
  258. universal_mcp/applications/wrike/app.py +1583 -0
  259. universal_mcp/applications/youtube/README.md +57 -0
  260. universal_mcp/applications/youtube/__init__.py +1 -0
  261. universal_mcp/applications/youtube/app.py +1696 -0
  262. universal_mcp/applications/zenquotes/README.md +12 -0
  263. universal_mcp/applications/zenquotes/__init__.py +1 -0
  264. universal_mcp/applications/zenquotes/app.py +31 -0
  265. universal_mcp_applications-0.1.1.dist-info/METADATA +172 -0
  266. universal_mcp_applications-0.1.1.dist-info/RECORD +268 -0
  267. universal_mcp_applications-0.1.1.dist-info/WHEEL +4 -0
  268. universal_mcp_applications-0.1.1.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,20 @@
1
+ # HashnodeApp MCP Server
2
+
3
+ An MCP Server for the HashnodeApp API.
4
+
5
+ ## 🛠️ Tool List
6
+
7
+ This is automatically generated from OpenAPI schema for the HashnodeApp API.
8
+
9
+
10
+ | Tool | Description |
11
+ |------|-------------|
12
+ | `publish_post` | Publishes a post to Hashnode using the GraphQL API. |
13
+ | `get_me` | Fetches details about the authenticated user. |
14
+ | `get_publication` | Fetches details about a publication by host or ID. Only one of host or publication_id should be provided. |
15
+ | `get_post` | Fetches details of a single post by slug and hostname. |
16
+ | `update_post` | Updates an existing post using the GraphQL API. |
17
+ | `delete_post` | Deletes a post using the GraphQL API. |
18
+ | `add_comment` | Adds a comment to a post using the GraphQL API. |
19
+ | `delete_comment` | Deletes a comment using the GraphQL API. |
20
+ | `get_user` | Fetches details about a user by username. |
@@ -0,0 +1 @@
1
+ from .app import HashnodeApp
@@ -0,0 +1,455 @@
1
+ from gql import gql
2
+ from universal_mcp.applications import GraphQLApplication
3
+ from universal_mcp.integrations import Integration
4
+
5
+
6
+ class HashnodeApp(GraphQLApplication):
7
+ def __init__(self, integration: Integration | None = None, **kwargs) -> None:
8
+ super().__init__(name="hashnode", base_url="https://gql.hashnode.com", **kwargs)
9
+ self.integration = integration
10
+
11
+ def publish_post(
12
+ self,
13
+ publication_id: str,
14
+ title: str,
15
+ content: str,
16
+ tags: list[str] = None,
17
+ slug: str = None,
18
+ subtitle: str = None,
19
+ cover_image: str = None,
20
+ ) -> str:
21
+ """
22
+ Publishes a post to Hashnode using the GraphQL API.
23
+
24
+ Args:
25
+ publication_id: The ID of the publication to publish the post to
26
+ title: The title of the post
27
+ content: The markdown content of the post
28
+ tags: Optional list of tag names to add to the post. Example: ["blog", "release-notes", "python", "ai"]
29
+ slug: Optional custom URL slug for the post. Example: "my-post"
30
+ subtitle: Optional subtitle for the post. Example: "A subtitle for my post"
31
+ cover_image: Optional: The URL of the cover image for the post. Example: "https://example.com/cover-image.jpg"
32
+ Returns:
33
+ The URL of the published post
34
+
35
+ Raises:
36
+ GraphQLError: If the API request fails
37
+
38
+ Tags:
39
+ publish, post, hashnode, api, important
40
+ """
41
+ publish_post_mutation = gql("""
42
+ mutation PublishPost($input: PublishPostInput!) {
43
+ publishPost(input: $input) {
44
+ post {
45
+ url
46
+ }
47
+ }
48
+ }
49
+ """)
50
+
51
+ variables = {
52
+ "input": {
53
+ "publicationId": publication_id,
54
+ "title": title,
55
+ "contentMarkdown": content,
56
+ }
57
+ }
58
+
59
+ if tags:
60
+ variables["input"]["tags"] = [
61
+ {"name": tag, "slug": tag.replace(" ", "-").lower()} for tag in tags
62
+ ]
63
+
64
+ if slug:
65
+ variables["input"]["slug"] = slug
66
+
67
+ if subtitle:
68
+ variables["input"]["subtitle"] = subtitle
69
+
70
+ if cover_image:
71
+ variables["input"]["bannerImageOptions"] = {
72
+ "url": cover_image,
73
+ "potrait": False,
74
+ }
75
+
76
+ result = self.mutate(publish_post_mutation, variables)
77
+ return result["publishPost"]["post"]["url"]
78
+
79
+ def get_me(self) -> dict:
80
+ """
81
+ Fetches details about the authenticated user.
82
+
83
+ Returns:
84
+ A dictionary containing the authenticated user's details.
85
+
86
+ Raises:
87
+ Exception: If the API request fails or no data is returned.
88
+
89
+ Tags:
90
+ get, me, hashnode, api, query, important
91
+ """
92
+ get_me_query = gql("""
93
+ query Me {
94
+ me {
95
+ id
96
+ username
97
+ name
98
+ bio {
99
+ markdown
100
+ html
101
+ text
102
+ }
103
+ profilePicture
104
+ socialMediaLinks {
105
+ website
106
+ github
107
+ twitter
108
+ instagram
109
+ facebook
110
+ stackoverflow
111
+ linkedin
112
+ youtube
113
+ bluesky
114
+ }
115
+ emailNotificationPreferences {
116
+ weeklyNewsletterEmails
117
+ activityNotifications
118
+ generalAnnouncements
119
+ monthlyBlogStats
120
+ newFollowersWeekly
121
+ }
122
+ followersCount
123
+ followingsCount
124
+ tagline
125
+ dateJoined
126
+ location
127
+ availableFor
128
+ email
129
+ unverifiedEmail
130
+ role
131
+ }
132
+ }
133
+ """)
134
+
135
+ result = self.query(get_me_query)
136
+
137
+ # It's good practice to check if 'me' exists in the result
138
+ if "me" in result:
139
+ return result.get("me")
140
+ else:
141
+ raise Exception("Failed to retrieve 'me' data from Hashnode API response.")
142
+
143
+ def get_publication(self, host: str = None, publication_id: str = None) -> dict:
144
+ """
145
+ Fetches details about a publication by host or ID. Only one of host or publication_id should be provided.
146
+
147
+ Args:
148
+ host: The host (domain) of the publication. Example: "myblog.hashnode.dev"
149
+ publication_id: The ID of the publication.
150
+
151
+ Returns:
152
+ A dictionary containing publication details.
153
+
154
+ Raises:
155
+ GraphQLError: If the API request fails.
156
+ ValueError: If neither host nor publication_id is provided.
157
+
158
+ Tags:
159
+ get, publication, hashnode, api, query, important
160
+ """
161
+ if not host and not publication_id:
162
+ raise ValueError("Either host or publication_id must be provided.")
163
+
164
+ query_string = """
165
+ query Publication($host: String, $id: ObjectId) {
166
+ publication(host: $host, id: $id) {
167
+ id
168
+ title
169
+ url
170
+ isTeam
171
+ posts(first: 5) {
172
+ edges {
173
+ node {
174
+ id
175
+ }
176
+ }
177
+ }
178
+ }
179
+ }
180
+ """
181
+ get_publication_query = gql(query_string)
182
+
183
+ # Construct variables such that only one of host or id is included
184
+ if host:
185
+ variables = {"host": host}
186
+ else:
187
+ variables = {"id": publication_id}
188
+
189
+ result = self.query(get_publication_query, variables)
190
+ return result.get("publication")
191
+
192
+ def get_post(self, post_id: str) -> dict:
193
+ """
194
+ Fetches details of a single post by slug and hostname.
195
+
196
+ Args:
197
+ post_id: The ID of the post to fetch details for. This can be fetched by using get_publication method.
198
+
199
+ Returns:
200
+ A dictionary containing post details.
201
+
202
+ Raises:
203
+ GraphQLError: If the API request fails.
204
+
205
+ Tags:
206
+ get, post, hashnode, api, query, important
207
+ """
208
+ get_post_query = gql("""
209
+ query Post($id: ID!) {
210
+ post(id: $id) {
211
+ id
212
+ slug
213
+ previousSlugs
214
+ title
215
+ subtitle
216
+ author {
217
+ id
218
+ username
219
+ name
220
+ }
221
+ comments(first: 5) {
222
+ edges {
223
+ node {
224
+ id
225
+ }
226
+ }
227
+ }
228
+ }
229
+ }
230
+ """)
231
+ variables = {"id": post_id}
232
+ result = self.query(get_post_query, variables)
233
+ return result.get("post")
234
+
235
+ def update_post(
236
+ self,
237
+ post_id: str,
238
+ title: str = None,
239
+ content: str = None,
240
+ tags: list[str] = None,
241
+ slug: str = None,
242
+ subtitle: str = None,
243
+ cover_image: str = None,
244
+ ) -> str:
245
+ """
246
+ Updates an existing post using the GraphQL API.
247
+
248
+ Args:
249
+ post_id: The ID of the post to update.
250
+ title: Optional new title for the post.
251
+ content: Optional new markdown content for the post.
252
+ tags: Optional new list of tag names for the post. Example: ["blog", "release-notes"]
253
+ slug: Optional new custom URL slug for the post.
254
+ subtitle: Optional new subtitle for the post.
255
+ cover_image: Optional new URL of the cover image for the post.
256
+
257
+ Returns:
258
+ The URL of the updated post.
259
+
260
+ Raises:
261
+ GraphQLError: If the API request fails.
262
+
263
+ Tags:
264
+ update, post, hashnode, api
265
+ """
266
+ update_post_mutation = gql("""
267
+ mutation UpdatePost($input: UpdatePostInput!) {
268
+ updatePost(input: $input) {
269
+ post {
270
+ url
271
+ }
272
+ }
273
+ }
274
+ """)
275
+
276
+ variables = {
277
+ "input": {
278
+ "id": post_id,
279
+ }
280
+ }
281
+
282
+ if title:
283
+ variables["input"]["title"] = title
284
+ if content:
285
+ variables["input"]["contentMarkdown"] = (
286
+ content # Assuming 'contentMarkdown' is the field name for content
287
+ )
288
+ if tags:
289
+ variables["input"]["tags"] = [
290
+ {"name": tag, "slug": tag.replace(" ", "-").lower()} for tag in tags
291
+ ]
292
+ if slug:
293
+ variables["input"]["slug"] = slug
294
+ if subtitle:
295
+ variables["input"]["subtitle"] = subtitle
296
+ if cover_image:
297
+ variables["input"]["bannerImageOptions"] = {
298
+ "url": cover_image,
299
+ "potrait": False, # Assuming 'potrait' is a required field for bannerImageOptions
300
+ }
301
+
302
+ result = self.mutate(update_post_mutation, variables)
303
+ return result["updatePost"]["post"]["url"]
304
+
305
+ def delete_post(self, post_id: str) -> str:
306
+ """
307
+ Deletes a post using the GraphQL API.
308
+
309
+ Args:
310
+ post_id: The ID of the post to delete.
311
+
312
+ Returns:
313
+ A confirmation message or identifier for the deleted post. (The exact return depends on API response)
314
+
315
+ Raises:
316
+ GraphQLError: If the API request fails.
317
+
318
+ Tags:
319
+ delete, post, hashnode, api
320
+ """
321
+ delete_post_mutation = gql("""
322
+ mutation RemovePost($input: RemovePostInput!) {
323
+ removePost(input: $input) {
324
+ post {
325
+ id
326
+ slug
327
+ previousSlugs
328
+ title
329
+ subtitle
330
+ }
331
+ }
332
+ }
333
+ """)
334
+ variables = {"input": {"id": post_id}}
335
+ result = self.mutate(delete_post_mutation, variables)
336
+ return result.get("deletePost", {}).get("id", "Post deleted successfully")
337
+
338
+ def add_comment(self, post_id: str, content: str) -> dict:
339
+ """
340
+ Adds a comment to a post using the GraphQL API.
341
+
342
+ Args:
343
+ post_id: The ID of the post to add the comment to.
344
+ content: The markdown content of the comment.
345
+
346
+ Returns:
347
+ A dictionary containing details of the added comment.
348
+
349
+ Raises:
350
+ GraphQLError: If the API request fails.
351
+
352
+ Tags:
353
+ add, comment, post, hashnode, api, important
354
+ """
355
+ add_comment_mutation = gql("""
356
+ mutation AddComment($input: AddCommentInput!) {
357
+ addComment(input: $input) {
358
+ comment {
359
+ id
360
+ content {
361
+ markdown
362
+ }
363
+ author {
364
+ id
365
+ username
366
+ }
367
+ }
368
+ }
369
+ }
370
+ """)
371
+ variables = {
372
+ "input": {
373
+ "postId": post_id,
374
+ "contentMarkdown": content,
375
+ }
376
+ }
377
+ result = self.mutate(add_comment_mutation, variables)
378
+ return result.get("addComment", {}).get("comment")
379
+
380
+ def delete_comment(self, comment_id: str) -> str:
381
+ """
382
+ Deletes a comment using the GraphQL API.
383
+
384
+ Args:
385
+ comment_id: The ID of the comment to delete. This can be known from when you add a comment using add_comment method or by fetching the post details using get_post method.
386
+
387
+ Returns:
388
+ A confirmation message or identifier for the deleted comment. (The exact return depends on API response)
389
+
390
+ Raises:
391
+ GraphQLError: If the API request fails.
392
+
393
+ Tags:
394
+ delete, comment, hashnode, api
395
+ """
396
+ delete_comment_mutation = gql("""
397
+ mutation RemoveComment($input: RemoveCommentInput!) {
398
+ removeComment(input: $input) {
399
+ comment {
400
+ id
401
+ }
402
+ }
403
+ }
404
+ """)
405
+ variables = {"input": {"id": comment_id}}
406
+ result = self.mutate(delete_comment_mutation, variables)
407
+ return result.get("removeComment", {}).get(
408
+ "id", "Comment deleted successfully"
409
+ ) # Adjust based on actual API return
410
+
411
+ def get_user(self, username: str) -> dict:
412
+ """
413
+ Fetches details about a user by username.
414
+
415
+ Args:
416
+ username: The username of the user.
417
+
418
+ Returns:
419
+ A dictionary containing user details.
420
+
421
+ Raises:
422
+ GraphQLError: If the API request fails.
423
+
424
+ Tags:
425
+ get, user, hashnode, api, query
426
+ """
427
+ get_user_query = gql("""
428
+ query User($username: String!) {
429
+ user(username: $username) {
430
+ id
431
+ username
432
+ name
433
+ tagline
434
+ profilePicture
435
+ followersCount
436
+ followingsCount
437
+ }
438
+ }
439
+ """)
440
+ variables = {"username": username}
441
+ result = self.query(get_user_query, variables)
442
+ return result.get("user")
443
+
444
+ def list_tools(self):
445
+ return [
446
+ self.publish_post,
447
+ self.get_me,
448
+ self.get_publication,
449
+ self.get_post,
450
+ self.update_post,
451
+ self.delete_post,
452
+ self.add_comment,
453
+ self.delete_comment,
454
+ self.get_user,
455
+ ]
@@ -0,0 +1,44 @@
1
+ # HeygenApp MCP Server
2
+
3
+ An MCP Server for the HeygenApp API.
4
+
5
+ ## 🛠️ Tool List
6
+
7
+ This is automatically generated from OpenAPI schema for the HeygenApp API.
8
+
9
+
10
+ | Tool | Description |
11
+ |------|-------------|
12
+ | `get_v1_voice_list` | Retrieves the list of available voices from the v1 voice API endpoint. |
13
+ | `get_v1_avatar_list` | Retrieves a list of available avatars from the v1 API endpoint. |
14
+ | `get_v2_voices` | Retrieves the list of available v2 voices from the API endpoint. |
15
+ | `get_v2_avatars` | Retrieves a list of avatar objects from the /v2/avatars API endpoint. |
16
+ | `get_v1_video_list` | Retrieves a list of videos from the v1 API endpoint. |
17
+ | `post_v2_video_generate` | Submits a request to generate a video using specified input parameters via the v2 video generate API endpoint. |
18
+ | `delete_v1_video` | Deletes a video using the v1 API endpoint with the specified video ID. |
19
+ | `get_v2_templates` | Retrieves the list of v2 templates from the API endpoint. |
20
+ | `get_v2_template_by_id` | Retrieves a v2 template resource by its unique identifier. |
21
+ | `post_v2_template_generate_by_id` | Generates content from a template specified by ID using the provided title and variables, and returns the generation result. |
22
+ | `get_v2_video_translate_target_languages` | Retrieves the list of supported target languages for video translation via the v2 API. |
23
+ | `post_v2_video_translate` | Submits a video translation request and returns the API response as JSON. |
24
+ | `get_v2_video_translate_status_by_id` | Retrieves the status of a video translation job by its unique identifier. |
25
+ | `post_streaming_new` | Initiates a new streaming session with optional quality parameter and returns the server's JSON response. |
26
+ | `get_streaming_list` | Retrieves the list of available streaming resources from the remote API. |
27
+ | `post_streaming_ice` | Sends an ICE candidate for a streaming session to the server and returns the JSON response. |
28
+ | `post_streaming_task` | Submits a streaming task for the specified session and text input, returning the response from the remote API. |
29
+ | `post_streaming_stop` | Stops an ongoing streaming session by sending a stop request for the specified session ID. |
30
+ | `post_streaming_interrupt` | Sends a request to interrupt an active streaming session identified by the given session ID. |
31
+ | `post_streaming_create_token` | Creates a new streaming token with an optional expiry time by sending a POST request to the streaming token API endpoint. |
32
+ | `get_streaming_avatar_list` | Retrieves a list of available streaming avatars from the API endpoint. |
33
+ | `get_v1_webhook_list` | Retrieves a list of all registered webhooks via the v1 API endpoint. |
34
+ | `post_v1_webhook_endpoint_add` | Registers a new webhook endpoint with the specified URL and events. |
35
+ | `delete_v1_webhook_endpoint_by_id` | Deletes a webhook endpoint identified by its ID via a DELETE request to the v1 API. |
36
+ | `get_v1_webhook_endpoint_list` | Retrieves a list of webhook endpoints from the v1 API. |
37
+ | `get_v1_talking_photo_list` | Retrieves the list of talking photos from the v1 API endpoint. |
38
+ | `delete_v2_talking_photo_by_id` | Deletes a v2 talking photo resource identified by its unique ID. |
39
+ | `post_personalized_video_add_contact` | Adds a new contact to a personalized video project by sending the contact variables to the server. |
40
+ | `get_personalized_video_audience_detail` | Retrieves detailed information about a personalized video audience by ID. |
41
+ | `get_personalized_video_project_detail` | Retrieves the details of a personalized video project by its unique identifier. |
42
+ | `get_v2_user_remaining_quota` | Retrieves the current remaining quota information for the user from the v2 API endpoint. |
43
+ | `post_v1_asset_upload` | Uploads an asset to the server using a POST request to the '/v1/asset' endpoint. |
44
+ | `get_v1_video_status` | Retrieves the status of a video by making a GET request to the v1 video_status endpoint. |
@@ -0,0 +1 @@
1
+ from .app import HeygenApp