There are at least three options available to litigate this dispute.
The first doesn't actually require going to court unless the other side tries to sue you. The second would probably be cheaper if the suit could be brought in a limited jurisdiction district court rather than a general jurisdiction superior court. The third would have to be brought in a superior court which would usually be slower and more expensive than bringing suit in district court.
Also, @IñakiViggers is correct that the contract might require mediation prior to commencing litigation, or might require an arbitration forum. That would need to be confirmed before someone files suit. Both kinds of terms would be common in contracts like the one described.
The usual one is to stop paying and advise the non-performing party why you are doing so (which takes little or no legal fees). Then, the non-performing party has to sue you to get paid, and you have a credible defense against that suit. But, you can't be sure in advance that the court will rule in your favor.
A Suit For A Refund
A second option would be to sue the service provider for a refund of the amounts already paid which were not earned as a result of non-performance. This breach of contract suit would be proper in any court with jurisdiction over breach of contract suits with the appropriate amount in controversy in the lawsuit. The service provider would then probably counterclaim against you for the amount owed for which you have not yet paid (if any).
A declaration of the rights of the parties would have to be made by the court incident to resolving the claim for money judgment relief in the case.
A Declaratory Judgment Action
A third option is to bring a suit for "declaratory judgment". This is a lawsuit brought when there is a bona fide dispute between the parties concerning the interpretation of a legal issues such as contract interpretation or statutory interpretation as applied to a particular situation. The court would then rule on the question of whether you had a right to withhold payment before you risked being sued, without providing any other relief.
If the court determined that the breach of contract eliminated your obligation to pay, you could then cease to pay and request a refund of what you have already paid without risking being sued for non-payment which could hurt your credit rating, or put you at risk of violating some loan covenant that considers being sued for non-payment of a debt to be an event of default unless a bond is posted for the payment of that debt (which is not uncommon in business loan agreements).
It is not entirely settled whether a declaratory judgment action is equitable or not. In some circumstances in some jurisdictions, these kinds of lawsuits are aways treated as equitable because they don't seek either a money judgment or possession of specific real property or personal property, which are the primary kinds of remedies allowed in non-equitable cases called "actions arising at law". Other jurisdictions, for example, for the purpose of determining a right to a jury trial, look to whether the underlying dispute in which relief is sought arises at law or in equity to determine the character of the action.
Usually, case law interpreting or the express language of, the statute setting out the jurisdiction of particular courts, or the statute or constitutional provision authorizing declaratory judgment actions in a jurisdiction, will address the question of whether a particular kind of court has jurisdiction to entertain declaratory judgment actions. As explained below, in MA, a statute expressly states which courts do and do not have jurisdiction to enter declaratory judgments.
A suit for an injunction is always one seeking equitable relief, but an injunction is a court order directing someone to refrain from taking a particular action, or ordering someone to take a particular action, rather than simply declaring what the law says about the rights of the parties in a particular situation without actually requiring either party to do, or refrain from doing anything, as a declaratory judgment does. In the situation that you describe in the question, the proper court in which to bring a declaratory judgment action regarding this dispute would be the superior court.
In MA, the statute describing jurisdiction to enter a declaratory judgment is M.G.L.A. 231A, § 1. It states (emphasis added and paragraph break added for ease of reading in this digital format):
§ 1. Power to make declaratory determination; jury questions
The supreme judicial court, the superior court, the land court and the probate courts, within their respective jurisdictions, may on
appropriate proceedings make binding declarations of right, duty,
status and other legal relations sought thereby, either before or
after a breach or violation thereof has occurred in any case in which
an actual controversy has arisen and is specifically set forth in the
pleadings and whether any consequential judgment or relief is or could
be claimed at law or in equity or not; and such proceeding shall not
be open to objection on the ground that a merely declaratory judgment
or decree is sought thereby and such declaration, when made, shall
have the force and effect of a final judgment or decree and be
reviewable as such; provided, that nothing contained herein shall be
construed to authorize the change, extension or alteration of the law
regulating the method of obtaining service on, or jurisdiction over,
parties or affect their right to trial by jury.
When a declaration of right, or the granting of further relief based
thereon, shall involve the determination of issues of fact triable by
a jury as of right and as to which a jury trial is duly claimed by the
party entitled thereto, or issues which the court, in accordance with
the practice of courts of equity, considers should be tried by a jury,
such issues may be submitted to a jury in the form of questions, with
proper instructions by the court, whether a general verdict be
required or not.
As the language above indicates, for purposes of a right to a jury trial, MA is a state in which a declaratory judgment action is not automatically either at law or in equity, but instead the court looks through to the nature of the underlying dispute to determine if there is a right to a jury trial (which hinges on the distinction between law and equity).
FOOTNOTE RE STATUTORY DRAFTING STYLE
The MA declaratory judgment statute demonstrates a common feature of (bad) American statutory drafting, which is the use of very long compound, multi-clause sentences. This is disfavored in modern legal writing because it often gives rise to ambiguities in meaning and is hard to read.
This style became common because American statutory drafters were worried that if the entire concept of a statute was not contained in one sentence that a sentence from the statute could be truthfully quoted out of context in a way that would mislead a reader regarding the meaning of the statute as a whole. This was particularly a problem in the days when few people had easy access to the full statutory language of a law. Thus, many readers of a misleading out of context quote from a statute would not be able to review the full context of the quoted language to determine its true meaning.